rho-tau-extensions 5.5.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +2 -0
- data/LICENSE +21 -0
- data/README.md +6 -0
- data/Rakefile +90 -0
- data/libs/crosswalk.rb +2 -0
- data/libs/crosswalk/crosswalk.rb +2 -0
- data/libs/crosswalk/ext.yml +21 -0
- data/libs/crosswalk/ext/Crosswalk.xml +27 -0
- data/libs/crosswalk/ext/build +19 -0
- data/libs/crosswalk/ext/build.bat +29 -0
- data/libs/crosswalk/ext/platform/android/AndroidManifest.xml +9 -0
- data/libs/crosswalk/ext/platform/android/Rakefile +141 -0
- data/libs/crosswalk/ext/platform/android/adds/lib/armeabi/libxwalkcore.so +0 -0
- data/libs/crosswalk/ext/platform/android/adds/lib/armeabi/libxwalkdummy.so +0 -0
- data/libs/crosswalk/ext/platform/android/adds/lib/x86/libxwalkcore.so +0 -0
- data/libs/crosswalk/ext/platform/android/adds/lib/x86/libxwalkdummy.so +0 -0
- data/libs/crosswalk/ext/platform/android/adds/lib/xwalk_core_library_java.jar +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/bubble.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/bubble_arrow_up.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/color_picker_advanced_select_handle.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/crosswalk.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/dropdown_popup_background_down.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/dropdown_popup_background_up.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/ic_menu_share_holo_light.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/ic_search.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/ic_warning.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/ondemand_overlay.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/verify_checkmark.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-ldpi/crosswalk.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-mdpi/crosswalk.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-v21/button_borderless_compat.xml +10 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-v21/button_compat.xml +9 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/bubble.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/bubble_arrow_up.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/color_picker_advanced_select_handle.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/crosswalk.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/dropdown_popup_background_down.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/dropdown_popup_background_up.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/ic_menu_share_holo_light.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/ic_search.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/ic_warning.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/ondemand_overlay.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/verify_checkmark.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxhdpi/ic_menu_share_holo_light.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxhdpi/ic_search.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxhdpi/ic_warning.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxhdpi/verify_checkmark.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxxhdpi/ic_menu_share_holo_light.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxxhdpi/ic_search.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxxhdpi/ic_warning.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxxhdpi/verify_checkmark.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/autofill_chip_inset.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/bubble.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/bubble_arrow_up.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/button_compat_shape.xml +9 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/color_button_background.xml +36 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/color_picker_advanced_select_handle.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/color_picker_border.xml +12 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/dropdown_label_color.xml +11 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/dropdown_popup_background.xml +13 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/dropdown_popup_background_down.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/dropdown_popup_background_up.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/ic_menu_share_holo_light.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/ic_search.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/ic_warning.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/launchscreen_bg.xml +19 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/ondemand_overlay.9.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/drawable/verify_checkmark.png +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout-land/date_time_picker_dialog.xml +42 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/autofill_keyboard_accessory_item.xml +40 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/autofill_suggestion_item.xml +18 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/color_picker_advanced_component.xml +46 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/color_picker_dialog_content.xml +51 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/color_picker_dialog_title.xml +41 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/date_time_suggestion.xml +35 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/dropdown_item.xml +58 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/multi_field_time_picker_dialog.xml +122 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/two_field_date_picker.xml +38 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/validation_message_bubble.xml +72 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/autofill_keyboard_accessory_icon.xml +13 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/autofill_keyboard_accessory_item.xml +17 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/autofill_suggestion_item.xml +7 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/color_picker_advanced_component.xml +30 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/color_picker_dialog_content.xml +36 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/color_picker_dialog_title.xml +25 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/date_time_picker_dialog.xml +42 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/date_time_suggestion.xml +16 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/dropdown_item.xml +34 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/multi_field_time_picker_dialog.xml +50 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/two_field_date_picker.xml +26 -0
- data/libs/crosswalk/ext/platform/android/adds/res/layout/validation_message_bubble.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/menu/select_action_menu.xml +54 -0
- data/libs/crosswalk/ext/platform/android/adds/res/raw/contacts_api.js +206 -0
- data/libs/crosswalk/ext/platform/android/adds/res/raw/device_capabilities_api.js +231 -0
- data/libs/crosswalk/ext/platform/android/adds/res/raw/empty.wav +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/raw/icudtl.dat +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/raw/launch_screen_api.js +9 -0
- data/libs/crosswalk/ext/platform/android/adds/res/raw/messaging_api.js +359 -0
- data/libs/crosswalk/ext/platform/android/adds/res/raw/presentation_api.js +144 -0
- data/libs/crosswalk/ext/platform/android/adds/res/raw/wifidirect_api.js +227 -0
- data/libs/crosswalk/ext/platform/android/adds/res/raw/xwalk.pak +0 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-am/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-am/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ar/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ar/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-bg/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-bg/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ca/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ca/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-cs/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-cs/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-da/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-da/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-de/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-de/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-el/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-el/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-en-rGB/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-en-rGB/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-es-rUS/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-es-rUS/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-es/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-es/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-fa/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-fa/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-fi/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-fi/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-fr/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-fr/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-hi/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-hi/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-hr/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-hr/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-hu/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-hu/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-in/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-in/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-it/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-it/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-iw/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-iw/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ja/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ja/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ko/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ko/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-lt/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-lt/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-lv/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-lv/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-nb/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-nb/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-nl/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-nl/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-pl/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-pl/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-pt-rBR/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-pt-rBR/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-pt-rPT/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-pt-rPT/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ro/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ro/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ru/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-ru/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-sk/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-sk/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-sl/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-sl/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-sr/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-sr/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-sv/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-sv/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-sw/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-sw/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-th/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-th/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-tl/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-tl/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-tr/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-tr/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-uk/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-uk/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-v14/theme.xml +16 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-v17/styles.xml +19 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-v17/ui_java_styles.xml +41 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-v21/styles.xml +14 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-v21/ui_java_styles.xml +14 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-vi/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-vi/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-zh-rCN/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-zh-rCN/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-zh-rTW/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values-zh-rTW/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/android_content_strings.xml +15 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/android_ui_strings.xml +47 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/android_xwalk_strings.xml +17 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/ui_java_attrs.xml +9 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/ui_java_dimens.xml +31 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/ui_java_strings.xml +16 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/ui_java_styles.xml +101 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_app_strings.xml +28 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_attrs.xml +11 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_colors.xml +13 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_core_internal_java_strings.xml +16 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_core_java_strings.xml +16 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_dimens.xml +11 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_resources_list.xml +7 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_styles.xml +40 -0
- data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_values.xml +10 -0
- data/libs/crosswalk/ext/platform/android/ext_java.files +14 -0
- data/libs/crosswalk/ext/platform/android/ext_native.files +7 -0
- data/libs/crosswalk/ext/platform/android/jni/Crosswalk_impl.cpp +61 -0
- data/libs/crosswalk/ext/platform/android/src/com/rho/crosswalk/Crosswalk.java +14 -0
- data/libs/crosswalk/ext/platform/android/src/com/rho/crosswalk/CrosswalkFactory.java +18 -0
- data/libs/crosswalk/ext/platform/android/src/com/rho/crosswalk/CrosswalkSingleton.java +24 -0
- data/libs/crosswalk/ext/platform/android/src/com/tautechnologies/tau/crosswalk/CrosswalkExtension.java +16 -0
- data/libs/crosswalk/ext/platform/android/src/com/tautechnologies/tau/crosswalk/RhodesListener.java +18 -0
- data/libs/crosswalk/ext/platform/android/src/com/tautechnologies/tau/crosswalk/TauXWResourceClient.java +182 -0
- data/libs/crosswalk/ext/platform/android/src/com/tautechnologies/tau/crosswalk/TauXWUIClient.java +125 -0
- data/libs/crosswalk/ext/platform/android/src/com/tautechnologies/tau/crosswalk/TauXWalkWebView.java +368 -0
- data/libs/crosswalk/ext/platform/iphone/Crosswalk.xcodeproj/project.pbxproj +368 -0
- data/libs/crosswalk/ext/platform/iphone/Crosswalk_Prefix.pch +7 -0
- data/libs/crosswalk/ext/platform/iphone/Rakefile +73 -0
- data/libs/crosswalk/ext/platform/iphone/impl/Crosswalk.h +14 -0
- data/libs/crosswalk/ext/platform/iphone/impl/Crosswalk.m +24 -0
- data/libs/crosswalk/ext/platform/iphone/impl/CrosswalkFactorySingleton.m +16 -0
- data/libs/crosswalk/ext/platform/iphone/impl/CrosswalkSetup.m +9 -0
- data/libs/crosswalk/ext/platform/iphone/impl/CrosswalkSingleton.h +17 -0
- data/libs/crosswalk/ext/platform/iphone/impl/CrosswalkSingleton.m +23 -0
- data/libs/crosswalk/ext/platform/iphone/impl/readme.txt +7 -0
- data/libs/crosswalk/ext/platform/qt/Crosswalk.pro +66 -0
- data/libs/crosswalk/ext/platform/qt/Rakefile +35 -0
- data/libs/crosswalk/ext/platform/qt/src/Crosswalk_impl.cpp +77 -0
- data/libs/crosswalk/ext/platform/wm/Crosswalk.sln +52 -0
- data/libs/crosswalk/ext/platform/wm/Crosswalk.vcproj +714 -0
- data/libs/crosswalk/ext/platform/wm/Crosswalk.vsprops +15 -0
- data/libs/crosswalk/ext/platform/wm/src/Crosswalk_impl.cpp +77 -0
- data/libs/crosswalk/ext/platform/wp8/Crosswalk.props +18 -0
- data/libs/crosswalk/ext/platform/wp8/Crosswalk.vcxproj +170 -0
- data/libs/crosswalk/ext/platform/wp8/Crosswalk.vcxproj.filters +50 -0
- data/libs/crosswalk/ext/platform/wp8/CrosswalkImpl.csproj +119 -0
- data/libs/crosswalk/ext/platform/wp8/CrosswalkImpl.props +8 -0
- data/libs/crosswalk/ext/platform/wp8/CrosswalkImpl.targets +7 -0
- data/libs/crosswalk/ext/platform/wp8/CrosswalkLib.props +18 -0
- data/libs/crosswalk/ext/platform/wp8/CrosswalkLib.vcxproj +185 -0
- data/libs/crosswalk/ext/platform/wp8/CrosswalkLib.vcxproj.filters +58 -0
- data/libs/crosswalk/ext/platform/wp8/src/Crosswalk_impl.cpp +76 -0
- data/libs/crosswalk/ext/platform/wp8/src/Crosswalk_impl.cs +69 -0
- data/libs/crosswalk/ext/platform/wp8/src/Properties/AssemblyInfo.cs +37 -0
- data/libs/enterprise-barcode/ext.yml +13 -0
- data/libs/enterprise-barcode/ext/barcode.xml +2144 -0
- data/libs/enterprise-barcode/ext/build +17 -0
- data/libs/enterprise-barcode/ext/build.bat +29 -0
- data/libs/enterprise-barcode/ext/platform/android/AndroidManifest.xml +31 -0
- data/libs/enterprise-barcode/ext/platform/android/ZXing_Info/AUTHORS +58 -0
- data/libs/enterprise-barcode/ext/platform/android/ZXing_Info/CHANGES +266 -0
- data/libs/enterprise-barcode/ext/platform/android/ZXing_Info/COPYING +201 -0
- data/libs/enterprise-barcode/ext/platform/android/ZXing_Info/README +11 -0
- data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable-hdpi/cancel_icon.png +0 -0
- data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable-hdpi/ok_icon.png +0 -0
- data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable-hdpi/retake_icon.png +0 -0
- data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable/cancel_icon.png +0 -0
- data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable/ok_icon.png +0 -0
- data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable/retake_icon.png +0 -0
- data/libs/enterprise-barcode/ext/platform/android/additional_files/res/layout/capture.xml +122 -0
- data/libs/enterprise-barcode/ext/platform/android/additional_files/res/raw/beep.ogg +0 -0
- data/libs/enterprise-barcode/ext/platform/android/additional_files/res/values/attrs.xml +20 -0
- data/libs/enterprise-barcode/ext/platform/android/additional_files/res/values/colors.xml +42 -0
- data/libs/enterprise-barcode/ext/platform/android/additional_files/res/values/ids.xml +31 -0
- data/libs/enterprise-barcode/ext/platform/android/adds/lib/armeabi/liballbarcode.a +0 -0
- data/libs/enterprise-barcode/ext/platform/android/adds/lib/x86/liballbarcode.a +0 -0
- data/libs/enterprise-barcode/ext/platform/android/allbarcode.jar +0 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Barcode.xcodeproj/project.pbxproj +524 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Barcode_Prefix.pch +7 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeCallbackHelper.h +27 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeCallbackHelper.mm +231 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewController.h +95 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewController.m +1017 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewFactory.h +7 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewFactory.mm +58 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewFactoryRegister.mm +18 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewManager.h +16 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewManager.mm +32 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/ImageProvider.cpp +25 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/ImageProvider.h +15 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/ImageProvider.mm +159 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Classes/barcode.m +123 -0
- data/libs/enterprise-barcode/ext/platform/iphone/Rakefile +69 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/COPYING +27 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarCameraSimulator.h +45 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarCaptureReader.h +111 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarHelpController.h +60 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarImage.h +69 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarImageScanner.h +51 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarReaderController.h +142 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarReaderView.h +135 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarReaderViewController.h +130 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarSDK.h +34 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarSymbol.h +71 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar.h +1497 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Decoder.h +202 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Exception.h +187 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Image.h +321 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/ImageScanner.h +130 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Processor.h +223 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Scanner.h +162 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Symbol.h +528 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Video.h +170 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Window.h +136 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/LICENSE +504 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/README +59 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Resources/zbar-back.png +0 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Resources/zbar-help.html +88 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Resources/zbar-helpicons.png +0 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Resources/zbar-samples.png +0 -0
- data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/libzbar.a +0 -0
- data/libs/enterprise-barcode/ext/platform/iphone/impl/Barcode.h +21 -0
- data/libs/enterprise-barcode/ext/platform/iphone/impl/Barcode.m +132 -0
- data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeFactory.h +10 -0
- data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeFactory.m +16 -0
- data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeFactorySingleton.m +16 -0
- data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeSetup.m +8 -0
- data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeSingleton.h +17 -0
- data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeSingleton.m +22 -0
- data/libs/enterprise-barcode/ext/platform/iphone/impl/readme.txt +7 -0
- data/libs/enterprise-barcode/ext/platform/wm/Barcode.sln +44 -0
- data/libs/enterprise-barcode/ext/platform/wm/Barcode.vcproj +836 -0
- data/libs/enterprise-barcode/ext/platform/wm/Barcode.vsprops +15 -0
- data/libs/enterprise-barcode/ext/platform/wm/readme.txt +0 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/Barcode_impl.cpp +376 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/DecodeNotifier.cpp +173 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/DecodeNotifier.h +149 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/EMDKInterfaceAbstraction.cpp +476 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/GetDecoderProperties.cpp +1195 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/GetScannerProperties.cpp +553 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/KeyInjector.cpp +177 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/KeyInjector.h +40 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/NotificationLoader.cpp +76 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/NotificationLoader.h +44 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/RSM.cpp +1211 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/Scanner.cpp +2609 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/Scanner.h +1099 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/ScannerDefines.h +322 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/SetDecoderProperties.cpp +2106 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/SetScannerProperties.cpp +1060 -0
- data/libs/enterprise-barcode/ext/platform/wm/src/Utilities.cpp +184 -0
- data/libs/enterprise-barcode/ext/platform/wp8/BarcodeImpl.csproj +119 -0
- data/libs/enterprise-barcode/ext/platform/wp8/BarcodeImpl.props +8 -0
- data/libs/enterprise-barcode/ext/platform/wp8/BarcodeImpl.targets +35 -0
- data/libs/enterprise-barcode/ext/platform/wp8/BarcodeLib.props +18 -0
- data/libs/enterprise-barcode/ext/platform/wp8/BarcodeLib.vcxproj +185 -0
- data/libs/enterprise-barcode/ext/platform/wp8/BarcodeLib.vcxproj.filters +58 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.Graphics.Imaging.dll +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.Graphics.Imaging.winmd +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.Graphics.Imaging.xml +4813 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.InteropServices.WindowsRuntime.dll +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.InteropServices.WindowsRuntime.winmd +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.InteropServices.WindowsRuntime.xml +41 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/OpticalReaderLib.dll +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib.XML +68 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib.dll +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/BarcodeReaderLib.csproj +120 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/BarcodeReaderLib.sln +34 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/CameraNavigatePage.xaml +32 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/CameraNavigatePage.xaml.cs +235 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/OpticalReaderTask.cs +182 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/Properties/AssemblyInfo.cs +37 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/Nokia.Graphics.Imaging.Managed.dll +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/Nokia.Graphics.Imaging.Managed.xml +341 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.Graphics.Imaging.dll +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.Graphics.Imaging.winmd +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.Graphics.Imaging.xml +4813 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.InteropServices.WindowsRuntime.dll +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.InteropServices.WindowsRuntime.winmd +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.InteropServices.WindowsRuntime.xml +41 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/OpticalReaderLib.dll +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/zxing.wp8.0.XML +10324 -0
- data/libs/enterprise-barcode/ext/platform/wp8/lib/zxing.wp8.0.dll +0 -0
- data/libs/enterprise-barcode/ext/platform/wp8/src/Barcode_impl.cs +630 -0
- data/libs/enterprise-barcode/ext/platform/wp8/src/Properties/AssemblyInfo.cs +37 -0
- data/libs/enterprise-barcode/public/api/generated/Rho.Barcode.js +772 -0
- data/libs/ie/rhobrowser.dll +0 -0
- data/libs/nodejs.rb +2 -0
- data/libs/nodejs/ext.yml +25 -0
- data/libs/nodejs/ext/Nodejs.xml +37 -0
- data/libs/nodejs/ext/build +19 -0
- data/libs/nodejs/ext/build.bat +29 -0
- data/libs/nodejs/ext/platform/android/Rakefile +161 -0
- data/libs/nodejs/ext/platform/android/ext_native.files +8 -0
- data/libs/nodejs/ext/platform/android/jxCore/jx.h +134 -0
- data/libs/nodejs/ext/platform/android/jxCore/jx_result.h +221 -0
- data/libs/nodejs/ext/platform/android/jxCore/libcares_arm.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libcares_ia32.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libcares_x64.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libchrome_zlib_arm.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libchrome_zlib_ia32.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libchrome_zlib_x64.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libhttp_parser_arm.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libhttp_parser_ia32.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libhttp_parser_x64.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libjx_arm.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libjx_ia32.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libjx_x64.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libopenssl_arm.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libopenssl_ia32.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libopenssl_x64.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libsqlite3_arm.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libsqlite3_ia32.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libsqlite3_x64.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libuv_arm.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libuv_ia32.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libuv_x64.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libv8_base_arm.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libv8_base_ia32.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libv8_base_x64.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libv8_nosnapshot_arm.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libv8_nosnapshot_ia32.a +0 -0
- data/libs/nodejs/ext/platform/android/jxCore/libv8_nosnapshot_x64.a +0 -0
- data/libs/nodejs/ext/platform/iphone/Nodejs.xcodeproj/project.pbxproj +350 -0
- data/libs/nodejs/ext/platform/iphone/Nodejs_Prefix.pch +7 -0
- data/libs/nodejs/ext/platform/iphone/Rakefile +73 -0
- data/libs/nodejs/ext/platform/iphone/jxCore/jx.h +134 -0
- data/libs/nodejs/ext/platform/iphone/jxCore/jx_result.h +221 -0
- data/libs/nodejs/ext/platform/iphone/jxCore/libcares.a +0 -0
- data/libs/nodejs/ext/platform/iphone/jxCore/libchrome_zlib.a +0 -0
- data/libs/nodejs/ext/platform/iphone/jxCore/libhttp_parser.a +0 -0
- data/libs/nodejs/ext/platform/iphone/jxCore/libjx.a +0 -0
- data/libs/nodejs/ext/platform/iphone/jxCore/libmozjs.a +0 -0
- data/libs/nodejs/ext/platform/iphone/jxCore/libopenssl.a +0 -0
- data/libs/nodejs/ext/platform/iphone/jxCore/libsqlite3.a +0 -0
- data/libs/nodejs/ext/platform/iphone/jxCore/libuv.a +0 -0
- data/libs/nodejs/ext/shared/jxcore/jx.h +134 -0
- data/libs/nodejs/ext/shared/jxcore/jx_result.h +221 -0
- data/libs/nodejs/ext/shared/jxcoretau.cpp +454 -0
- data/libs/nodejs/ext/shared/jxcoretau.h +20 -0
- data/libs/nodejs/ext/shared/nodejs_impl.cpp +106 -0
- data/libs/nodejs/nodejs.rb +2 -0
- data/libs/openssl-edge.rb +2 -0
- data/libs/openssl-edge/ext.yml +4 -0
- data/libs/openssl-edge/ext/Rakefile +145 -0
- data/libs/openssl-edge/ext/android/Rakefile +107 -0
- data/libs/openssl-edge/ext/android/ext_native.files +32 -0
- data/libs/openssl-edge/ext/android/extconf.h +91 -0
- data/libs/openssl-edge/ext/build +12 -0
- data/libs/openssl-edge/ext/build.bat +5 -0
- data/libs/openssl-edge/ext/extconf.rb +141 -0
- data/libs/openssl-edge/ext/openssl.pro +109 -0
- data/libs/openssl-edge/ext/openssl.sln +52 -0
- data/libs/openssl-edge/ext/openssl.vcproj +1010 -0
- data/libs/openssl-edge/ext/openssl_missing.c +1163 -0
- data/libs/openssl-edge/ext/openssl_missing.h +537 -0
- data/libs/openssl-edge/ext/ossl.c +1203 -0
- data/libs/openssl-edge/ext/ossl.h +242 -0
- data/libs/openssl-edge/ext/ossl_asn1.c +2008 -0
- data/libs/openssl-edge/ext/ossl_asn1.h +66 -0
- data/libs/openssl-edge/ext/ossl_bio.c +118 -0
- data/libs/openssl-edge/ext/ossl_bio.h +19 -0
- data/libs/openssl-edge/ext/ossl_bn.c +1153 -0
- data/libs/openssl-edge/ext/ossl_bn.h +23 -0
- data/libs/openssl-edge/ext/ossl_cipher.c +1085 -0
- data/libs/openssl-edge/ext/ossl_cipher.h +20 -0
- data/libs/openssl-edge/ext/ossl_config.c +89 -0
- data/libs/openssl-edge/ext/ossl_config.h +19 -0
- data/libs/openssl-edge/ext/ossl_digest.c +453 -0
- data/libs/openssl-edge/ext/ossl_digest.h +20 -0
- data/libs/openssl-edge/ext/ossl_engine.c +580 -0
- data/libs/openssl-edge/ext/ossl_engine.h +19 -0
- data/libs/openssl-edge/ext/ossl_hmac.c +398 -0
- data/libs/openssl-edge/ext/ossl_hmac.h +18 -0
- data/libs/openssl-edge/ext/ossl_ns_spki.c +406 -0
- data/libs/openssl-edge/ext/ossl_ns_spki.h +19 -0
- data/libs/openssl-edge/ext/ossl_ocsp.c +2013 -0
- data/libs/openssl-edge/ext/ossl_ocsp.h +23 -0
- data/libs/openssl-edge/ext/ossl_pkcs12.c +261 -0
- data/libs/openssl-edge/ext/ossl_pkcs12.h +13 -0
- data/libs/openssl-edge/ext/ossl_pkcs5.c +180 -0
- data/libs/openssl-edge/ext/ossl_pkcs5.h +6 -0
- data/libs/openssl-edge/ext/ossl_pkcs7.c +1157 -0
- data/libs/openssl-edge/ext/ossl_pkcs7.h +20 -0
- data/libs/openssl-edge/ext/ossl_pkey.c +469 -0
- data/libs/openssl-edge/ext/ossl_pkey.h +245 -0
- data/libs/openssl-edge/ext/ossl_pkey_dh.c +650 -0
- data/libs/openssl-edge/ext/ossl_pkey_dsa.c +672 -0
- data/libs/openssl-edge/ext/ossl_pkey_ec.c +1806 -0
- data/libs/openssl-edge/ext/ossl_pkey_rsa.c +768 -0
- data/libs/openssl-edge/ext/ossl_rand.c +238 -0
- data/libs/openssl-edge/ext/ossl_rand.h +18 -0
- data/libs/openssl-edge/ext/ossl_ssl.c +2724 -0
- data/libs/openssl-edge/ext/ossl_ssl.h +41 -0
- data/libs/openssl-edge/ext/ossl_ssl_session.c +352 -0
- data/libs/openssl-edge/ext/ossl_version.h +15 -0
- data/libs/openssl-edge/ext/ossl_x509.c +186 -0
- data/libs/openssl-edge/ext/ossl_x509.h +119 -0
- data/libs/openssl-edge/ext/ossl_x509attr.c +328 -0
- data/libs/openssl-edge/ext/ossl_x509cert.c +863 -0
- data/libs/openssl-edge/ext/ossl_x509crl.c +565 -0
- data/libs/openssl-edge/ext/ossl_x509ext.c +480 -0
- data/libs/openssl-edge/ext/ossl_x509name.c +547 -0
- data/libs/openssl-edge/ext/ossl_x509req.c +492 -0
- data/libs/openssl-edge/ext/ossl_x509revoked.c +279 -0
- data/libs/openssl-edge/ext/ossl_x509store.c +846 -0
- data/libs/openssl-edge/ext/ruby_missing.h +32 -0
- data/libs/openssl-edge/openssl-edge.rb +2 -0
- data/libs/openssl-edge/openssl.rb +24 -0
- data/libs/openssl-edge/openssl/bn.rb +35 -0
- data/libs/openssl-edge/openssl/buffering.rb +341 -0
- data/libs/openssl-edge/openssl/cipher.rb +65 -0
- data/libs/openssl-edge/openssl/digest.rb +61 -0
- data/libs/openssl-edge/openssl/ssl-internal.rb +180 -0
- data/libs/openssl-edge/openssl/ssl.rb +1 -0
- data/libs/openssl-edge/openssl/x509-internal.rb +153 -0
- data/libs/openssl-edge/openssl/x509.rb +1 -0
- data/libs/openssl.so-edge.rb +2 -0
- data/libs/openssl.so-edge/ext.yml +8 -0
- data/libs/openssl.so-edge/ext/Rakefile +140 -0
- data/libs/openssl.so-edge/ext/android/armeabi/libcrypto.a +0 -0
- data/libs/openssl.so-edge/ext/android/armeabi/libssl.a +0 -0
- data/libs/openssl.so-edge/ext/android/x86/libcrypto.a +0 -0
- data/libs/openssl.so-edge/ext/android/x86/libssl.a +0 -0
- data/libs/openssl.so-edge/ext/build +12 -0
- data/libs/openssl.so-edge/ext/build.bat +1 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/dh/dh_locl.h +56 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/dsa/dsa_locl.h +76 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/evp/evp_locl.h +66 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/hmac/hmac_lcl.h +33 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/asn1_int.h +94 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/async.h +14 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/bn_conf.h +28 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/bn_dh.h +17 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/bn_int.h +82 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/bn_srp.h +32 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/chacha.h +49 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/cryptlib.h +81 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/cryptlib_int.h +31 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/dso_conf.h +16 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/engine.h +20 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/err_int.h +17 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/evp_int.h +382 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/md32_common.h +383 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/objects.h +12 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/poly1305.h +19 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/rand.h +20 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/x509_int.h +267 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/ocsp/ocsp_lcl.h +216 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/rsa/rsa_locl.h +96 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/x509/x509_lcl.h +142 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/e_os.h +520 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/bio.h +26 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/comp.h +12 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/conf.h +32 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/constant_time_locl.h +185 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/dane.h +103 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/dso.h +216 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/err.h +15 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/numbers.h +68 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/o_dir.h +63 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/o_str.h +17 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/thread_once.h +42 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/__DECC_INCLUDE_EPILOGUE.H +16 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/__DECC_INCLUDE_PROLOGUE.H +20 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/aes.h +92 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/asn1.h +1096 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/asn1_mac.h +10 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/asn1t.h +924 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/async.h +98 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/bio.h +854 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/blowfish.h +61 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/bn.h +575 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/buffer.h +76 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/camellia.h +83 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/cast.h +53 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/cmac.h +41 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/cms.h +512 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/comp.h +72 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/conf.h +216 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/conf_api.h +40 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/crypto.h +463 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ct.h +518 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/des.h +174 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/dh.h +343 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/dsa.h +282 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/dtls1.h +56 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/e_os2.h +311 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ebcdic.h +33 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ec.h +1581 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ecdh.h +10 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ecdsa.h +10 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/engine.h +842 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/err.h +259 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/evp.h +1586 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/hmac.h +49 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/idea.h +64 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/kdf.h +75 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/lhash.h +204 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/md2.h +44 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/md4.h +51 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/md5.h +50 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/mdc2.h +42 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/modes.h +203 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/obj_mac.h +4577 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/objects.h +1097 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ocsp.h +409 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/opensslconf.h +169 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/opensslconf.h.in +141 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/opensslv.h +105 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ossl_typ.h +190 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/pem.h +501 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/pem2.h +20 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/pkcs12.h +282 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/pkcs7.h +404 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/rand.h +89 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/rc2.h +51 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/rc4.h +36 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/rc5.h +63 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ripemd.h +47 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/rsa.h +588 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/safestack.h +164 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/seed.h +98 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/sha.h +119 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/srp.h +131 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/srtp.h +50 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ssl.h +2527 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ssl2.h +24 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ssl3.h +307 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/stack.h +78 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/symhacks.h +52 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/tls1.h +972 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ts.h +643 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/txt_db.h +57 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ui.h +368 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/whrlpool.h +48 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/x509.h +1123 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/x509_vfy.h +539 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/x509v3.h +1005 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/packet_locl.h +555 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/record/record.h +240 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/record/record_locl.h +114 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/ssl_locl.h +2127 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/statem/statem.h +123 -0
- data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/statem/statem_locl.h +124 -0
- data/libs/openssl.so-edge/openssl.so.rb +2 -0
- data/libs/webkit.rb +2 -0
- data/libs/webkit/ext.yml +4 -0
- data/libs/webkit/ext/build +12 -0
- data/libs/webkit/ext/build.bat +7 -0
- data/libs/webkit/ext/wm/Rakefile +61 -0
- data/libs/webkit/ext/wm/RhoMsgs.cpp +17 -0
- data/libs/webkit/ext/wm/RhoMsgs.h +14 -0
- data/libs/webkit/ext/wm/RhoWKBrowserEngine.cpp +736 -0
- data/libs/webkit/ext/wm/RhoWKBrowserEngine.h +105 -0
- data/libs/webkit/ext/wm/lib/npapi/rhobridge.dll +0 -0
- data/libs/webkit/ext/wm/lib/rhoengine_defs.h +80 -0
- data/libs/webkit/ext/wm/lib/rhowebkit.dll +0 -0
- data/libs/webkit/ext/wm/webkit.sln +36 -0
- data/libs/webkit/ext/wm/webkit.suo +0 -0
- data/libs/webkit/ext/wm/webkit.vcproj +800 -0
- data/libs/webkit/ext/wm/webkit.vsprops +20 -0
- data/libs/webkit/webkit.rb +2 -0
- data/rho-tau-extensions.gemspec +23 -0
- data/version +1 -0
- metadata +705 -0
@@ -0,0 +1,119 @@
|
|
1
|
+
/*
|
2
|
+
* 'OpenSSL for Ruby' project
|
3
|
+
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
|
4
|
+
* All rights reserved.
|
5
|
+
*/
|
6
|
+
/*
|
7
|
+
* This program is licensed under the same licence as Ruby.
|
8
|
+
* (See the file 'LICENCE'.)
|
9
|
+
*/
|
10
|
+
#if !defined(_OSSL_X509_H_)
|
11
|
+
#define _OSSL_X509_H_
|
12
|
+
|
13
|
+
/*
|
14
|
+
* X509 main module
|
15
|
+
*/
|
16
|
+
extern VALUE mX509;
|
17
|
+
|
18
|
+
/*
|
19
|
+
* Converts the VALUE into Integer and set it to the ASN1_TIME. This is a
|
20
|
+
* wrapper for X509_time_adj_ex() so passing NULL creates a new ASN1_TIME.
|
21
|
+
* Note that the caller must check the NULL return.
|
22
|
+
*/
|
23
|
+
ASN1_TIME *ossl_x509_time_adjust(ASN1_TIME *, VALUE);
|
24
|
+
|
25
|
+
void Init_ossl_x509(void);
|
26
|
+
|
27
|
+
/*
|
28
|
+
* X509Attr
|
29
|
+
*/
|
30
|
+
extern VALUE cX509Attr;
|
31
|
+
extern VALUE eX509AttrError;
|
32
|
+
|
33
|
+
VALUE ossl_x509attr_new(X509_ATTRIBUTE *);
|
34
|
+
X509_ATTRIBUTE *GetX509AttrPtr(VALUE);
|
35
|
+
void Init_ossl_x509attr(void);
|
36
|
+
|
37
|
+
/*
|
38
|
+
* X509Cert
|
39
|
+
*/
|
40
|
+
extern VALUE cX509Cert;
|
41
|
+
extern VALUE eX509CertError;
|
42
|
+
|
43
|
+
VALUE ossl_x509_new(X509 *);
|
44
|
+
VALUE ossl_x509_new_from_file(VALUE);
|
45
|
+
X509 *GetX509CertPtr(VALUE);
|
46
|
+
X509 *DupX509CertPtr(VALUE);
|
47
|
+
void Init_ossl_x509cert(void);
|
48
|
+
|
49
|
+
/*
|
50
|
+
* X509CRL
|
51
|
+
*/
|
52
|
+
extern VALUE cX509CRL;
|
53
|
+
extern VALUE eX509CRLError;
|
54
|
+
|
55
|
+
VALUE ossl_x509crl_new(X509_CRL *);
|
56
|
+
X509_CRL *GetX509CRLPtr(VALUE);
|
57
|
+
X509_CRL *DupX509CRLPtr(VALUE);
|
58
|
+
void Init_ossl_x509crl(void);
|
59
|
+
|
60
|
+
/*
|
61
|
+
* X509Extension
|
62
|
+
*/
|
63
|
+
extern VALUE cX509Ext;
|
64
|
+
extern VALUE cX509ExtFactory;
|
65
|
+
extern VALUE eX509ExtError;
|
66
|
+
|
67
|
+
VALUE ossl_x509ext_new(X509_EXTENSION *);
|
68
|
+
X509_EXTENSION *GetX509ExtPtr(VALUE);
|
69
|
+
void Init_ossl_x509ext(void);
|
70
|
+
|
71
|
+
/*
|
72
|
+
* X509Name
|
73
|
+
*/
|
74
|
+
extern VALUE cX509Name;
|
75
|
+
extern VALUE eX509NameError;
|
76
|
+
|
77
|
+
VALUE ossl_x509name_new(X509_NAME *);
|
78
|
+
X509_NAME *GetX509NamePtr(VALUE);
|
79
|
+
void Init_ossl_x509name(void);
|
80
|
+
|
81
|
+
/*
|
82
|
+
* X509Request
|
83
|
+
*/
|
84
|
+
extern VALUE cX509Req;
|
85
|
+
extern VALUE eX509ReqError;
|
86
|
+
|
87
|
+
VALUE ossl_x509req_new(X509_REQ *);
|
88
|
+
X509_REQ *GetX509ReqPtr(VALUE);
|
89
|
+
X509_REQ *DupX509ReqPtr(VALUE);
|
90
|
+
void Init_ossl_x509req(void);
|
91
|
+
|
92
|
+
/*
|
93
|
+
* X509Revoked
|
94
|
+
*/
|
95
|
+
extern VALUE cX509Rev;
|
96
|
+
extern VALUE eX509RevError;
|
97
|
+
|
98
|
+
VALUE ossl_x509revoked_new(X509_REVOKED *);
|
99
|
+
X509_REVOKED *DupX509RevokedPtr(VALUE);
|
100
|
+
void Init_ossl_x509revoked(void);
|
101
|
+
|
102
|
+
/*
|
103
|
+
* X509Store and X509StoreContext
|
104
|
+
*/
|
105
|
+
extern VALUE cX509Store;
|
106
|
+
extern VALUE cX509StoreContext;
|
107
|
+
extern VALUE eX509StoreError;
|
108
|
+
|
109
|
+
VALUE ossl_x509store_new(X509_STORE *);
|
110
|
+
X509_STORE *GetX509StorePtr(VALUE);
|
111
|
+
X509_STORE *DupX509StorePtr(VALUE);
|
112
|
+
|
113
|
+
VALUE ossl_x509stctx_new(X509_STORE_CTX *);
|
114
|
+
VALUE ossl_x509stctx_clear_ptr(VALUE);
|
115
|
+
X509_STORE_CTX *GetX509StCtxtPtr(VALUE);
|
116
|
+
|
117
|
+
void Init_ossl_x509store(void);
|
118
|
+
|
119
|
+
#endif /* _OSSL_X509_H_ */
|
@@ -0,0 +1,328 @@
|
|
1
|
+
/*
|
2
|
+
* 'OpenSSL for Ruby' project
|
3
|
+
* Copyright (C) 2001 Michal Rokos <m.rokos@sh.cvut.cz>
|
4
|
+
* All rights reserved.
|
5
|
+
*/
|
6
|
+
/*
|
7
|
+
* This program is licensed under the same licence as Ruby.
|
8
|
+
* (See the file 'LICENCE'.)
|
9
|
+
*/
|
10
|
+
#include "ossl.h"
|
11
|
+
|
12
|
+
#define NewX509Attr(klass) \
|
13
|
+
TypedData_Wrap_Struct((klass), &ossl_x509attr_type, 0)
|
14
|
+
#define SetX509Attr(obj, attr) do { \
|
15
|
+
if (!(attr)) { \
|
16
|
+
ossl_raise(rb_eRuntimeError, "ATTR wasn't initialized!"); \
|
17
|
+
} \
|
18
|
+
RTYPEDDATA_DATA(obj) = (attr); \
|
19
|
+
} while (0)
|
20
|
+
#define GetX509Attr(obj, attr) do { \
|
21
|
+
TypedData_Get_Struct((obj), X509_ATTRIBUTE, &ossl_x509attr_type, (attr)); \
|
22
|
+
if (!(attr)) { \
|
23
|
+
ossl_raise(rb_eRuntimeError, "ATTR wasn't initialized!"); \
|
24
|
+
} \
|
25
|
+
} while (0)
|
26
|
+
#define SafeGetX509Attr(obj, attr) do { \
|
27
|
+
OSSL_Check_Kind((obj), cX509Attr); \
|
28
|
+
GetX509Attr((obj), (attr)); \
|
29
|
+
} while (0)
|
30
|
+
|
31
|
+
/*
|
32
|
+
* Classes
|
33
|
+
*/
|
34
|
+
VALUE cX509Attr;
|
35
|
+
VALUE eX509AttrError;
|
36
|
+
|
37
|
+
static void
|
38
|
+
ossl_x509attr_free(void *ptr)
|
39
|
+
{
|
40
|
+
X509_ATTRIBUTE_free(ptr);
|
41
|
+
}
|
42
|
+
|
43
|
+
static const rb_data_type_t ossl_x509attr_type = {
|
44
|
+
"OpenSSL/X509/ATTRIBUTE",
|
45
|
+
{
|
46
|
+
0, ossl_x509attr_free,
|
47
|
+
},
|
48
|
+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
|
49
|
+
};
|
50
|
+
|
51
|
+
/*
|
52
|
+
* Public
|
53
|
+
*/
|
54
|
+
VALUE
|
55
|
+
ossl_x509attr_new(X509_ATTRIBUTE *attr)
|
56
|
+
{
|
57
|
+
X509_ATTRIBUTE *new;
|
58
|
+
VALUE obj;
|
59
|
+
|
60
|
+
obj = NewX509Attr(cX509Attr);
|
61
|
+
if (!attr) {
|
62
|
+
new = X509_ATTRIBUTE_new();
|
63
|
+
} else {
|
64
|
+
new = X509_ATTRIBUTE_dup(attr);
|
65
|
+
}
|
66
|
+
if (!new) {
|
67
|
+
ossl_raise(eX509AttrError, NULL);
|
68
|
+
}
|
69
|
+
SetX509Attr(obj, new);
|
70
|
+
|
71
|
+
return obj;
|
72
|
+
}
|
73
|
+
|
74
|
+
X509_ATTRIBUTE *
|
75
|
+
GetX509AttrPtr(VALUE obj)
|
76
|
+
{
|
77
|
+
X509_ATTRIBUTE *attr;
|
78
|
+
|
79
|
+
SafeGetX509Attr(obj, attr);
|
80
|
+
|
81
|
+
return attr;
|
82
|
+
}
|
83
|
+
|
84
|
+
/*
|
85
|
+
* Private
|
86
|
+
*/
|
87
|
+
static VALUE
|
88
|
+
ossl_x509attr_alloc(VALUE klass)
|
89
|
+
{
|
90
|
+
X509_ATTRIBUTE *attr;
|
91
|
+
VALUE obj;
|
92
|
+
|
93
|
+
obj = NewX509Attr(klass);
|
94
|
+
if (!(attr = X509_ATTRIBUTE_new()))
|
95
|
+
ossl_raise(eX509AttrError, NULL);
|
96
|
+
SetX509Attr(obj, attr);
|
97
|
+
|
98
|
+
return obj;
|
99
|
+
}
|
100
|
+
|
101
|
+
/*
|
102
|
+
* call-seq:
|
103
|
+
* Attribute.new(oid [, value]) => attr
|
104
|
+
*/
|
105
|
+
static VALUE
|
106
|
+
ossl_x509attr_initialize(int argc, VALUE *argv, VALUE self)
|
107
|
+
{
|
108
|
+
VALUE oid, value;
|
109
|
+
X509_ATTRIBUTE *attr, *x;
|
110
|
+
const unsigned char *p;
|
111
|
+
|
112
|
+
GetX509Attr(self, attr);
|
113
|
+
if(rb_scan_args(argc, argv, "11", &oid, &value) == 1){
|
114
|
+
oid = ossl_to_der_if_possible(oid);
|
115
|
+
StringValue(oid);
|
116
|
+
p = (unsigned char *)RSTRING_PTR(oid);
|
117
|
+
x = d2i_X509_ATTRIBUTE(&attr, &p, RSTRING_LEN(oid));
|
118
|
+
DATA_PTR(self) = attr;
|
119
|
+
if(!x){
|
120
|
+
ossl_raise(eX509AttrError, NULL);
|
121
|
+
}
|
122
|
+
return self;
|
123
|
+
}
|
124
|
+
rb_funcall(self, rb_intern("oid="), 1, oid);
|
125
|
+
rb_funcall(self, rb_intern("value="), 1, value);
|
126
|
+
|
127
|
+
return self;
|
128
|
+
}
|
129
|
+
|
130
|
+
static VALUE
|
131
|
+
ossl_x509attr_initialize_copy(VALUE self, VALUE other)
|
132
|
+
{
|
133
|
+
X509_ATTRIBUTE *attr, *attr_other, *attr_new;
|
134
|
+
|
135
|
+
rb_check_frozen(self);
|
136
|
+
GetX509Attr(self, attr);
|
137
|
+
SafeGetX509Attr(other, attr_other);
|
138
|
+
|
139
|
+
attr_new = X509_ATTRIBUTE_dup(attr_other);
|
140
|
+
if (!attr_new)
|
141
|
+
ossl_raise(eX509AttrError, "X509_ATTRIBUTE_dup");
|
142
|
+
|
143
|
+
SetX509Attr(self, attr_new);
|
144
|
+
X509_ATTRIBUTE_free(attr);
|
145
|
+
|
146
|
+
return self;
|
147
|
+
}
|
148
|
+
|
149
|
+
/*
|
150
|
+
* call-seq:
|
151
|
+
* attr.oid = string => string
|
152
|
+
*/
|
153
|
+
static VALUE
|
154
|
+
ossl_x509attr_set_oid(VALUE self, VALUE oid)
|
155
|
+
{
|
156
|
+
X509_ATTRIBUTE *attr;
|
157
|
+
ASN1_OBJECT *obj;
|
158
|
+
char *s;
|
159
|
+
|
160
|
+
GetX509Attr(self, attr);
|
161
|
+
s = StringValueCStr(oid);
|
162
|
+
obj = OBJ_txt2obj(s, 0);
|
163
|
+
if(!obj) ossl_raise(eX509AttrError, NULL);
|
164
|
+
if (!X509_ATTRIBUTE_set1_object(attr, obj)) {
|
165
|
+
ASN1_OBJECT_free(obj);
|
166
|
+
ossl_raise(eX509AttrError, "X509_ATTRIBUTE_set1_object");
|
167
|
+
}
|
168
|
+
ASN1_OBJECT_free(obj);
|
169
|
+
|
170
|
+
return oid;
|
171
|
+
}
|
172
|
+
|
173
|
+
/*
|
174
|
+
* call-seq:
|
175
|
+
* attr.oid => string
|
176
|
+
*/
|
177
|
+
static VALUE
|
178
|
+
ossl_x509attr_get_oid(VALUE self)
|
179
|
+
{
|
180
|
+
X509_ATTRIBUTE *attr;
|
181
|
+
ASN1_OBJECT *oid;
|
182
|
+
BIO *out;
|
183
|
+
VALUE ret;
|
184
|
+
int nid;
|
185
|
+
|
186
|
+
GetX509Attr(self, attr);
|
187
|
+
oid = X509_ATTRIBUTE_get0_object(attr);
|
188
|
+
if ((nid = OBJ_obj2nid(oid)) != NID_undef)
|
189
|
+
ret = rb_str_new2(OBJ_nid2sn(nid));
|
190
|
+
else{
|
191
|
+
if (!(out = BIO_new(BIO_s_mem())))
|
192
|
+
ossl_raise(eX509AttrError, NULL);
|
193
|
+
i2a_ASN1_OBJECT(out, oid);
|
194
|
+
ret = ossl_membio2str(out);
|
195
|
+
}
|
196
|
+
|
197
|
+
return ret;
|
198
|
+
}
|
199
|
+
|
200
|
+
/*
|
201
|
+
* call-seq:
|
202
|
+
* attr.value = asn1 => asn1
|
203
|
+
*/
|
204
|
+
static VALUE
|
205
|
+
ossl_x509attr_set_value(VALUE self, VALUE value)
|
206
|
+
{
|
207
|
+
X509_ATTRIBUTE *attr;
|
208
|
+
VALUE asn1_value;
|
209
|
+
int i, asn1_tag;
|
210
|
+
|
211
|
+
OSSL_Check_Kind(value, cASN1Data);
|
212
|
+
asn1_tag = NUM2INT(rb_attr_get(value, rb_intern("@tag")));
|
213
|
+
asn1_value = rb_attr_get(value, rb_intern("@value"));
|
214
|
+
if (asn1_tag != V_ASN1_SET)
|
215
|
+
ossl_raise(eASN1Error, "argument must be ASN1::Set");
|
216
|
+
if (!RB_TYPE_P(asn1_value, T_ARRAY))
|
217
|
+
ossl_raise(eASN1Error, "ASN1::Set has non-array value");
|
218
|
+
|
219
|
+
GetX509Attr(self, attr);
|
220
|
+
if (X509_ATTRIBUTE_count(attr)) { /* populated, reset first */
|
221
|
+
ASN1_OBJECT *obj = X509_ATTRIBUTE_get0_object(attr);
|
222
|
+
X509_ATTRIBUTE *new_attr = X509_ATTRIBUTE_create_by_OBJ(NULL, obj, 0, NULL, -1);
|
223
|
+
if (!new_attr)
|
224
|
+
ossl_raise(eX509AttrError, NULL);
|
225
|
+
SetX509Attr(self, new_attr);
|
226
|
+
X509_ATTRIBUTE_free(attr);
|
227
|
+
attr = new_attr;
|
228
|
+
}
|
229
|
+
|
230
|
+
for (i = 0; i < RARRAY_LEN(asn1_value); i++) {
|
231
|
+
ASN1_TYPE *a1type = ossl_asn1_get_asn1type(RARRAY_AREF(asn1_value, i));
|
232
|
+
if (!X509_ATTRIBUTE_set1_data(attr, ASN1_TYPE_get(a1type),
|
233
|
+
a1type->value.ptr, -1)) {
|
234
|
+
ASN1_TYPE_free(a1type);
|
235
|
+
ossl_raise(eX509AttrError, NULL);
|
236
|
+
}
|
237
|
+
ASN1_TYPE_free(a1type);
|
238
|
+
}
|
239
|
+
|
240
|
+
return value;
|
241
|
+
}
|
242
|
+
|
243
|
+
/*
|
244
|
+
* call-seq:
|
245
|
+
* attr.value => asn1
|
246
|
+
*/
|
247
|
+
static VALUE
|
248
|
+
ossl_x509attr_get_value(VALUE self)
|
249
|
+
{
|
250
|
+
X509_ATTRIBUTE *attr;
|
251
|
+
STACK_OF(ASN1_TYPE) *sk;
|
252
|
+
VALUE str;
|
253
|
+
int i, count, len;
|
254
|
+
unsigned char *p;
|
255
|
+
|
256
|
+
GetX509Attr(self, attr);
|
257
|
+
/* there is no X509_ATTRIBUTE_get0_set() :( */
|
258
|
+
if (!(sk = sk_ASN1_TYPE_new_null()))
|
259
|
+
ossl_raise(eX509AttrError, "sk_new");
|
260
|
+
|
261
|
+
count = X509_ATTRIBUTE_count(attr);
|
262
|
+
for (i = 0; i < count; i++)
|
263
|
+
sk_ASN1_TYPE_push(sk, X509_ATTRIBUTE_get0_type(attr, i));
|
264
|
+
|
265
|
+
if ((len = i2d_ASN1_SET_ANY(sk, NULL)) <= 0) {
|
266
|
+
sk_ASN1_TYPE_free(sk);
|
267
|
+
ossl_raise(eX509AttrError, NULL);
|
268
|
+
}
|
269
|
+
str = rb_str_new(0, len);
|
270
|
+
p = (unsigned char *)RSTRING_PTR(str);
|
271
|
+
if (i2d_ASN1_SET_ANY(sk, &p) <= 0) {
|
272
|
+
sk_ASN1_TYPE_free(sk);
|
273
|
+
ossl_raise(eX509AttrError, NULL);
|
274
|
+
}
|
275
|
+
ossl_str_adjust(str, p);
|
276
|
+
sk_ASN1_TYPE_free(sk);
|
277
|
+
|
278
|
+
return rb_funcall(mASN1, rb_intern("decode"), 1, str);
|
279
|
+
}
|
280
|
+
|
281
|
+
/*
|
282
|
+
* call-seq:
|
283
|
+
* attr.to_der => string
|
284
|
+
*/
|
285
|
+
static VALUE
|
286
|
+
ossl_x509attr_to_der(VALUE self)
|
287
|
+
{
|
288
|
+
X509_ATTRIBUTE *attr;
|
289
|
+
VALUE str;
|
290
|
+
int len;
|
291
|
+
unsigned char *p;
|
292
|
+
|
293
|
+
GetX509Attr(self, attr);
|
294
|
+
if((len = i2d_X509_ATTRIBUTE(attr, NULL)) <= 0)
|
295
|
+
ossl_raise(eX509AttrError, NULL);
|
296
|
+
str = rb_str_new(0, len);
|
297
|
+
p = (unsigned char *)RSTRING_PTR(str);
|
298
|
+
if(i2d_X509_ATTRIBUTE(attr, &p) <= 0)
|
299
|
+
ossl_raise(eX509AttrError, NULL);
|
300
|
+
ossl_str_adjust(str, p);
|
301
|
+
|
302
|
+
return str;
|
303
|
+
}
|
304
|
+
|
305
|
+
/*
|
306
|
+
* X509_ATTRIBUTE init
|
307
|
+
*/
|
308
|
+
void
|
309
|
+
Init_ossl_x509attr(void)
|
310
|
+
{
|
311
|
+
#if 0
|
312
|
+
mOSSL = rb_define_module("OpenSSL");
|
313
|
+
eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
|
314
|
+
mX509 = rb_define_module_under(mOSSL, "X509");
|
315
|
+
#endif
|
316
|
+
|
317
|
+
eX509AttrError = rb_define_class_under(mX509, "AttributeError", eOSSLError);
|
318
|
+
|
319
|
+
cX509Attr = rb_define_class_under(mX509, "Attribute", rb_cObject);
|
320
|
+
rb_define_alloc_func(cX509Attr, ossl_x509attr_alloc);
|
321
|
+
rb_define_method(cX509Attr, "initialize", ossl_x509attr_initialize, -1);
|
322
|
+
rb_define_copy_func(cX509Attr, ossl_x509attr_initialize_copy);
|
323
|
+
rb_define_method(cX509Attr, "oid=", ossl_x509attr_set_oid, 1);
|
324
|
+
rb_define_method(cX509Attr, "oid", ossl_x509attr_get_oid, 0);
|
325
|
+
rb_define_method(cX509Attr, "value=", ossl_x509attr_set_value, 1);
|
326
|
+
rb_define_method(cX509Attr, "value", ossl_x509attr_get_value, 0);
|
327
|
+
rb_define_method(cX509Attr, "to_der", ossl_x509attr_to_der, 0);
|
328
|
+
}
|
@@ -0,0 +1,863 @@
|
|
1
|
+
/*
|
2
|
+
* 'OpenSSL for Ruby' project
|
3
|
+
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
|
4
|
+
* All rights reserved.
|
5
|
+
*/
|
6
|
+
/*
|
7
|
+
* This program is licensed under the same licence as Ruby.
|
8
|
+
* (See the file 'LICENCE'.)
|
9
|
+
*/
|
10
|
+
#include "ossl.h"
|
11
|
+
|
12
|
+
#define NewX509(klass) \
|
13
|
+
TypedData_Wrap_Struct((klass), &ossl_x509_type, 0)
|
14
|
+
#define SetX509(obj, x509) do { \
|
15
|
+
if (!(x509)) { \
|
16
|
+
ossl_raise(rb_eRuntimeError, "CERT wasn't initialized!"); \
|
17
|
+
} \
|
18
|
+
RTYPEDDATA_DATA(obj) = (x509); \
|
19
|
+
} while (0)
|
20
|
+
#define GetX509(obj, x509) do { \
|
21
|
+
TypedData_Get_Struct((obj), X509, &ossl_x509_type, (x509)); \
|
22
|
+
if (!(x509)) { \
|
23
|
+
ossl_raise(rb_eRuntimeError, "CERT wasn't initialized!"); \
|
24
|
+
} \
|
25
|
+
} while (0)
|
26
|
+
#define SafeGetX509(obj, x509) do { \
|
27
|
+
OSSL_Check_Kind((obj), cX509Cert); \
|
28
|
+
GetX509((obj), (x509)); \
|
29
|
+
} while (0)
|
30
|
+
|
31
|
+
/*
|
32
|
+
* Classes
|
33
|
+
*/
|
34
|
+
VALUE cX509Cert;
|
35
|
+
VALUE eX509CertError;
|
36
|
+
|
37
|
+
static void
|
38
|
+
ossl_x509_free(void *ptr)
|
39
|
+
{
|
40
|
+
X509_free(ptr);
|
41
|
+
}
|
42
|
+
|
43
|
+
static const rb_data_type_t ossl_x509_type = {
|
44
|
+
"OpenSSL/X509",
|
45
|
+
{
|
46
|
+
0, ossl_x509_free,
|
47
|
+
},
|
48
|
+
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
|
49
|
+
};
|
50
|
+
|
51
|
+
/*
|
52
|
+
* Public
|
53
|
+
*/
|
54
|
+
VALUE
|
55
|
+
ossl_x509_new(X509 *x509)
|
56
|
+
{
|
57
|
+
X509 *new;
|
58
|
+
VALUE obj;
|
59
|
+
|
60
|
+
obj = NewX509(cX509Cert);
|
61
|
+
if (!x509) {
|
62
|
+
new = X509_new();
|
63
|
+
} else {
|
64
|
+
new = X509_dup(x509);
|
65
|
+
}
|
66
|
+
if (!new) {
|
67
|
+
ossl_raise(eX509CertError, NULL);
|
68
|
+
}
|
69
|
+
SetX509(obj, new);
|
70
|
+
|
71
|
+
return obj;
|
72
|
+
}
|
73
|
+
|
74
|
+
VALUE
|
75
|
+
ossl_x509_new_from_file(VALUE filename)
|
76
|
+
{
|
77
|
+
X509 *x509;
|
78
|
+
FILE *fp;
|
79
|
+
VALUE obj;
|
80
|
+
|
81
|
+
rb_check_safe_obj(filename);
|
82
|
+
obj = NewX509(cX509Cert);
|
83
|
+
if (!(fp = fopen(StringValueCStr(filename), "r"))) {
|
84
|
+
ossl_raise(eX509CertError, "%s", strerror(errno));
|
85
|
+
}
|
86
|
+
|
87
|
+
//TAU
|
88
|
+
//rb_fd_fix_cloexec(fileno(fp));
|
89
|
+
|
90
|
+
x509 = PEM_read_X509(fp, NULL, NULL, NULL);
|
91
|
+
/*
|
92
|
+
* prepare for DER...
|
93
|
+
#if !defined(OPENSSL_NO_FP_API)
|
94
|
+
if (!x509) {
|
95
|
+
(void)ERR_get_error();
|
96
|
+
rewind(fp);
|
97
|
+
|
98
|
+
x509 = d2i_X509_fp(fp, NULL);
|
99
|
+
}
|
100
|
+
#endif
|
101
|
+
*/
|
102
|
+
fclose(fp);
|
103
|
+
if (!x509) {
|
104
|
+
ossl_raise(eX509CertError, NULL);
|
105
|
+
}
|
106
|
+
SetX509(obj, x509);
|
107
|
+
|
108
|
+
return obj;
|
109
|
+
}
|
110
|
+
|
111
|
+
X509 *
|
112
|
+
GetX509CertPtr(VALUE obj)
|
113
|
+
{
|
114
|
+
X509 *x509;
|
115
|
+
|
116
|
+
SafeGetX509(obj, x509);
|
117
|
+
|
118
|
+
return x509;
|
119
|
+
}
|
120
|
+
|
121
|
+
X509 *
|
122
|
+
DupX509CertPtr(VALUE obj)
|
123
|
+
{
|
124
|
+
X509 *x509;
|
125
|
+
|
126
|
+
SafeGetX509(obj, x509);
|
127
|
+
|
128
|
+
X509_up_ref(x509);
|
129
|
+
|
130
|
+
return x509;
|
131
|
+
}
|
132
|
+
|
133
|
+
/*
|
134
|
+
* Private
|
135
|
+
*/
|
136
|
+
static VALUE
|
137
|
+
ossl_x509_alloc(VALUE klass)
|
138
|
+
{
|
139
|
+
X509 *x509;
|
140
|
+
VALUE obj;
|
141
|
+
|
142
|
+
obj = NewX509(klass);
|
143
|
+
x509 = X509_new();
|
144
|
+
if (!x509) ossl_raise(eX509CertError, NULL);
|
145
|
+
SetX509(obj, x509);
|
146
|
+
|
147
|
+
return obj;
|
148
|
+
}
|
149
|
+
|
150
|
+
/*
|
151
|
+
* call-seq:
|
152
|
+
* Certificate.new => cert
|
153
|
+
* Certificate.new(string) => cert
|
154
|
+
*/
|
155
|
+
static VALUE
|
156
|
+
ossl_x509_initialize(int argc, VALUE *argv, VALUE self)
|
157
|
+
{
|
158
|
+
BIO *in;
|
159
|
+
X509 *x509, *x = DATA_PTR(self);
|
160
|
+
VALUE arg;
|
161
|
+
|
162
|
+
if (rb_scan_args(argc, argv, "01", &arg) == 0) {
|
163
|
+
/* create just empty X509Cert */
|
164
|
+
return self;
|
165
|
+
}
|
166
|
+
arg = ossl_to_der_if_possible(arg);
|
167
|
+
in = ossl_obj2bio(arg);
|
168
|
+
x509 = PEM_read_bio_X509(in, &x, NULL, NULL);
|
169
|
+
DATA_PTR(self) = x;
|
170
|
+
if (!x509) {
|
171
|
+
OSSL_BIO_reset(in);
|
172
|
+
x509 = d2i_X509_bio(in, &x);
|
173
|
+
DATA_PTR(self) = x;
|
174
|
+
}
|
175
|
+
BIO_free(in);
|
176
|
+
if (!x509) ossl_raise(eX509CertError, NULL);
|
177
|
+
|
178
|
+
return self;
|
179
|
+
}
|
180
|
+
|
181
|
+
static VALUE
|
182
|
+
ossl_x509_copy(VALUE self, VALUE other)
|
183
|
+
{
|
184
|
+
X509 *a, *b, *x509;
|
185
|
+
|
186
|
+
rb_check_frozen(self);
|
187
|
+
if (self == other) return self;
|
188
|
+
|
189
|
+
GetX509(self, a);
|
190
|
+
SafeGetX509(other, b);
|
191
|
+
|
192
|
+
x509 = X509_dup(b);
|
193
|
+
if (!x509) ossl_raise(eX509CertError, NULL);
|
194
|
+
|
195
|
+
DATA_PTR(self) = x509;
|
196
|
+
X509_free(a);
|
197
|
+
|
198
|
+
return self;
|
199
|
+
}
|
200
|
+
|
201
|
+
/*
|
202
|
+
* call-seq:
|
203
|
+
* cert.to_der => string
|
204
|
+
*/
|
205
|
+
static VALUE
|
206
|
+
ossl_x509_to_der(VALUE self)
|
207
|
+
{
|
208
|
+
X509 *x509;
|
209
|
+
VALUE str;
|
210
|
+
long len;
|
211
|
+
unsigned char *p;
|
212
|
+
|
213
|
+
GetX509(self, x509);
|
214
|
+
if ((len = i2d_X509(x509, NULL)) <= 0)
|
215
|
+
ossl_raise(eX509CertError, NULL);
|
216
|
+
str = rb_str_new(0, len);
|
217
|
+
p = (unsigned char *)RSTRING_PTR(str);
|
218
|
+
if (i2d_X509(x509, &p) <= 0)
|
219
|
+
ossl_raise(eX509CertError, NULL);
|
220
|
+
ossl_str_adjust(str, p);
|
221
|
+
|
222
|
+
return str;
|
223
|
+
}
|
224
|
+
|
225
|
+
/*
|
226
|
+
* call-seq:
|
227
|
+
* cert.to_pem => string
|
228
|
+
*/
|
229
|
+
static VALUE
|
230
|
+
ossl_x509_to_pem(VALUE self)
|
231
|
+
{
|
232
|
+
X509 *x509;
|
233
|
+
BIO *out;
|
234
|
+
VALUE str;
|
235
|
+
|
236
|
+
GetX509(self, x509);
|
237
|
+
out = BIO_new(BIO_s_mem());
|
238
|
+
if (!out) ossl_raise(eX509CertError, NULL);
|
239
|
+
|
240
|
+
if (!PEM_write_bio_X509(out, x509)) {
|
241
|
+
BIO_free(out);
|
242
|
+
ossl_raise(eX509CertError, NULL);
|
243
|
+
}
|
244
|
+
str = ossl_membio2str(out);
|
245
|
+
|
246
|
+
return str;
|
247
|
+
}
|
248
|
+
|
249
|
+
/*
|
250
|
+
* call-seq:
|
251
|
+
* cert.to_text => string
|
252
|
+
*/
|
253
|
+
static VALUE
|
254
|
+
ossl_x509_to_text(VALUE self)
|
255
|
+
{
|
256
|
+
X509 *x509;
|
257
|
+
BIO *out;
|
258
|
+
VALUE str;
|
259
|
+
|
260
|
+
GetX509(self, x509);
|
261
|
+
|
262
|
+
out = BIO_new(BIO_s_mem());
|
263
|
+
if (!out) ossl_raise(eX509CertError, NULL);
|
264
|
+
|
265
|
+
if (!X509_print(out, x509)) {
|
266
|
+
BIO_free(out);
|
267
|
+
ossl_raise(eX509CertError, NULL);
|
268
|
+
}
|
269
|
+
str = ossl_membio2str(out);
|
270
|
+
|
271
|
+
return str;
|
272
|
+
}
|
273
|
+
|
274
|
+
#if 0
|
275
|
+
/*
|
276
|
+
* Makes from X509 X509_REQuest
|
277
|
+
*/
|
278
|
+
static VALUE
|
279
|
+
ossl_x509_to_req(VALUE self)
|
280
|
+
{
|
281
|
+
X509 *x509;
|
282
|
+
X509_REQ *req;
|
283
|
+
VALUE obj;
|
284
|
+
|
285
|
+
GetX509(self, x509);
|
286
|
+
if (!(req = X509_to_X509_REQ(x509, NULL, EVP_md5()))) {
|
287
|
+
ossl_raise(eX509CertError, NULL);
|
288
|
+
}
|
289
|
+
obj = ossl_x509req_new(req);
|
290
|
+
X509_REQ_free(req);
|
291
|
+
|
292
|
+
return obj;
|
293
|
+
}
|
294
|
+
#endif
|
295
|
+
|
296
|
+
/*
|
297
|
+
* call-seq:
|
298
|
+
* cert.version => integer
|
299
|
+
*/
|
300
|
+
static VALUE
|
301
|
+
ossl_x509_get_version(VALUE self)
|
302
|
+
{
|
303
|
+
X509 *x509;
|
304
|
+
|
305
|
+
GetX509(self, x509);
|
306
|
+
|
307
|
+
return LONG2NUM(X509_get_version(x509));
|
308
|
+
}
|
309
|
+
|
310
|
+
/*
|
311
|
+
* call-seq:
|
312
|
+
* cert.version = integer => integer
|
313
|
+
*/
|
314
|
+
static VALUE
|
315
|
+
ossl_x509_set_version(VALUE self, VALUE version)
|
316
|
+
{
|
317
|
+
X509 *x509;
|
318
|
+
long ver;
|
319
|
+
|
320
|
+
if ((ver = NUM2LONG(version)) < 0) {
|
321
|
+
ossl_raise(eX509CertError, "version must be >= 0!");
|
322
|
+
}
|
323
|
+
GetX509(self, x509);
|
324
|
+
if (!X509_set_version(x509, ver)) {
|
325
|
+
ossl_raise(eX509CertError, NULL);
|
326
|
+
}
|
327
|
+
|
328
|
+
return version;
|
329
|
+
}
|
330
|
+
|
331
|
+
/*
|
332
|
+
* call-seq:
|
333
|
+
* cert.serial => integer
|
334
|
+
*/
|
335
|
+
static VALUE
|
336
|
+
ossl_x509_get_serial(VALUE self)
|
337
|
+
{
|
338
|
+
X509 *x509;
|
339
|
+
|
340
|
+
GetX509(self, x509);
|
341
|
+
|
342
|
+
return asn1integer_to_num(X509_get_serialNumber(x509));
|
343
|
+
}
|
344
|
+
|
345
|
+
/*
|
346
|
+
* call-seq:
|
347
|
+
* cert.serial = integer => integer
|
348
|
+
*/
|
349
|
+
static VALUE
|
350
|
+
ossl_x509_set_serial(VALUE self, VALUE num)
|
351
|
+
{
|
352
|
+
X509 *x509;
|
353
|
+
|
354
|
+
GetX509(self, x509);
|
355
|
+
X509_set_serialNumber(x509, num_to_asn1integer(num, X509_get_serialNumber(x509)));
|
356
|
+
|
357
|
+
return num;
|
358
|
+
}
|
359
|
+
|
360
|
+
/*
|
361
|
+
* call-seq:
|
362
|
+
* cert.signature_algorithm => string
|
363
|
+
*/
|
364
|
+
static VALUE
|
365
|
+
ossl_x509_get_signature_algorithm(VALUE self)
|
366
|
+
{
|
367
|
+
X509 *x509;
|
368
|
+
BIO *out;
|
369
|
+
VALUE str;
|
370
|
+
|
371
|
+
GetX509(self, x509);
|
372
|
+
out = BIO_new(BIO_s_mem());
|
373
|
+
if (!out) ossl_raise(eX509CertError, NULL);
|
374
|
+
|
375
|
+
if (!i2a_ASN1_OBJECT(out, X509_get0_tbs_sigalg(x509)->algorithm)) {
|
376
|
+
BIO_free(out);
|
377
|
+
ossl_raise(eX509CertError, NULL);
|
378
|
+
}
|
379
|
+
str = ossl_membio2str(out);
|
380
|
+
|
381
|
+
return str;
|
382
|
+
}
|
383
|
+
|
384
|
+
/*
|
385
|
+
* call-seq:
|
386
|
+
* cert.subject => name
|
387
|
+
*/
|
388
|
+
static VALUE
|
389
|
+
ossl_x509_get_subject(VALUE self)
|
390
|
+
{
|
391
|
+
X509 *x509;
|
392
|
+
X509_NAME *name;
|
393
|
+
|
394
|
+
GetX509(self, x509);
|
395
|
+
if (!(name = X509_get_subject_name(x509))) { /* NO DUP - don't free! */
|
396
|
+
ossl_raise(eX509CertError, NULL);
|
397
|
+
}
|
398
|
+
|
399
|
+
return ossl_x509name_new(name);
|
400
|
+
}
|
401
|
+
|
402
|
+
/*
|
403
|
+
* call-seq:
|
404
|
+
* cert.subject = name => name
|
405
|
+
*/
|
406
|
+
static VALUE
|
407
|
+
ossl_x509_set_subject(VALUE self, VALUE subject)
|
408
|
+
{
|
409
|
+
X509 *x509;
|
410
|
+
|
411
|
+
GetX509(self, x509);
|
412
|
+
if (!X509_set_subject_name(x509, GetX509NamePtr(subject))) { /* DUPs name */
|
413
|
+
ossl_raise(eX509CertError, NULL);
|
414
|
+
}
|
415
|
+
|
416
|
+
return subject;
|
417
|
+
}
|
418
|
+
|
419
|
+
/*
|
420
|
+
* call-seq:
|
421
|
+
* cert.issuer => name
|
422
|
+
*/
|
423
|
+
static VALUE
|
424
|
+
ossl_x509_get_issuer(VALUE self)
|
425
|
+
{
|
426
|
+
X509 *x509;
|
427
|
+
X509_NAME *name;
|
428
|
+
|
429
|
+
GetX509(self, x509);
|
430
|
+
if(!(name = X509_get_issuer_name(x509))) { /* NO DUP - don't free! */
|
431
|
+
ossl_raise(eX509CertError, NULL);
|
432
|
+
}
|
433
|
+
|
434
|
+
return ossl_x509name_new(name);
|
435
|
+
}
|
436
|
+
|
437
|
+
/*
|
438
|
+
* call-seq:
|
439
|
+
* cert.issuer = name => name
|
440
|
+
*/
|
441
|
+
static VALUE
|
442
|
+
ossl_x509_set_issuer(VALUE self, VALUE issuer)
|
443
|
+
{
|
444
|
+
X509 *x509;
|
445
|
+
|
446
|
+
GetX509(self, x509);
|
447
|
+
if (!X509_set_issuer_name(x509, GetX509NamePtr(issuer))) { /* DUPs name */
|
448
|
+
ossl_raise(eX509CertError, NULL);
|
449
|
+
}
|
450
|
+
|
451
|
+
return issuer;
|
452
|
+
}
|
453
|
+
|
454
|
+
/*
|
455
|
+
* call-seq:
|
456
|
+
* cert.not_before => time
|
457
|
+
*/
|
458
|
+
static VALUE
|
459
|
+
ossl_x509_get_not_before(VALUE self)
|
460
|
+
{
|
461
|
+
X509 *x509;
|
462
|
+
const ASN1_TIME *asn1time;
|
463
|
+
|
464
|
+
GetX509(self, x509);
|
465
|
+
if (!(asn1time = X509_get0_notBefore(x509))) {
|
466
|
+
ossl_raise(eX509CertError, NULL);
|
467
|
+
}
|
468
|
+
|
469
|
+
return asn1time_to_time(asn1time);
|
470
|
+
}
|
471
|
+
|
472
|
+
/*
|
473
|
+
* call-seq:
|
474
|
+
* cert.not_before = time => time
|
475
|
+
*/
|
476
|
+
static VALUE
|
477
|
+
ossl_x509_set_not_before(VALUE self, VALUE time)
|
478
|
+
{
|
479
|
+
X509 *x509;
|
480
|
+
ASN1_TIME *asn1time;
|
481
|
+
|
482
|
+
GetX509(self, x509);
|
483
|
+
asn1time = ossl_x509_time_adjust(NULL, time);
|
484
|
+
if (!X509_set_notBefore(x509, asn1time)) {
|
485
|
+
ASN1_TIME_free(asn1time);
|
486
|
+
ossl_raise(eX509CertError, "X509_set_notBefore");
|
487
|
+
}
|
488
|
+
ASN1_TIME_free(asn1time);
|
489
|
+
|
490
|
+
return time;
|
491
|
+
}
|
492
|
+
|
493
|
+
/*
|
494
|
+
* call-seq:
|
495
|
+
* cert.not_after => time
|
496
|
+
*/
|
497
|
+
static VALUE
|
498
|
+
ossl_x509_get_not_after(VALUE self)
|
499
|
+
{
|
500
|
+
X509 *x509;
|
501
|
+
const ASN1_TIME *asn1time;
|
502
|
+
|
503
|
+
GetX509(self, x509);
|
504
|
+
if (!(asn1time = X509_get0_notAfter(x509))) {
|
505
|
+
ossl_raise(eX509CertError, NULL);
|
506
|
+
}
|
507
|
+
|
508
|
+
return asn1time_to_time(asn1time);
|
509
|
+
}
|
510
|
+
|
511
|
+
/*
|
512
|
+
* call-seq:
|
513
|
+
* cert.not_after = time => time
|
514
|
+
*/
|
515
|
+
static VALUE
|
516
|
+
ossl_x509_set_not_after(VALUE self, VALUE time)
|
517
|
+
{
|
518
|
+
X509 *x509;
|
519
|
+
ASN1_TIME *asn1time;
|
520
|
+
|
521
|
+
GetX509(self, x509);
|
522
|
+
asn1time = ossl_x509_time_adjust(NULL, time);
|
523
|
+
if (!X509_set_notAfter(x509, asn1time)) {
|
524
|
+
ASN1_TIME_free(asn1time);
|
525
|
+
ossl_raise(eX509CertError, "X509_set_notAfter");
|
526
|
+
}
|
527
|
+
ASN1_TIME_free(asn1time);
|
528
|
+
|
529
|
+
return time;
|
530
|
+
}
|
531
|
+
|
532
|
+
/*
|
533
|
+
* call-seq:
|
534
|
+
* cert.public_key => key
|
535
|
+
*/
|
536
|
+
static VALUE
|
537
|
+
ossl_x509_get_public_key(VALUE self)
|
538
|
+
{
|
539
|
+
X509 *x509;
|
540
|
+
EVP_PKEY *pkey;
|
541
|
+
|
542
|
+
GetX509(self, x509);
|
543
|
+
if (!(pkey = X509_get_pubkey(x509))) { /* adds an reference */
|
544
|
+
ossl_raise(eX509CertError, NULL);
|
545
|
+
}
|
546
|
+
|
547
|
+
return ossl_pkey_new(pkey); /* NO DUP - OK */
|
548
|
+
}
|
549
|
+
|
550
|
+
/*
|
551
|
+
* call-seq:
|
552
|
+
* cert.public_key = key => key
|
553
|
+
*/
|
554
|
+
static VALUE
|
555
|
+
ossl_x509_set_public_key(VALUE self, VALUE key)
|
556
|
+
{
|
557
|
+
X509 *x509;
|
558
|
+
|
559
|
+
GetX509(self, x509);
|
560
|
+
if (!X509_set_pubkey(x509, GetPKeyPtr(key))) { /* DUPs pkey */
|
561
|
+
ossl_raise(eX509CertError, NULL);
|
562
|
+
}
|
563
|
+
|
564
|
+
return key;
|
565
|
+
}
|
566
|
+
|
567
|
+
/*
|
568
|
+
* call-seq:
|
569
|
+
* cert.sign(key, digest) => self
|
570
|
+
*/
|
571
|
+
static VALUE
|
572
|
+
ossl_x509_sign(VALUE self, VALUE key, VALUE digest)
|
573
|
+
{
|
574
|
+
X509 *x509;
|
575
|
+
EVP_PKEY *pkey;
|
576
|
+
const EVP_MD *md;
|
577
|
+
|
578
|
+
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
|
579
|
+
md = GetDigestPtr(digest);
|
580
|
+
GetX509(self, x509);
|
581
|
+
if (!X509_sign(x509, pkey, md)) {
|
582
|
+
ossl_raise(eX509CertError, NULL);
|
583
|
+
}
|
584
|
+
|
585
|
+
return self;
|
586
|
+
}
|
587
|
+
|
588
|
+
/*
|
589
|
+
* call-seq:
|
590
|
+
* cert.verify(key) => true | false
|
591
|
+
*
|
592
|
+
* Checks that cert signature is made with PRIVversion of this PUBLIC 'key'
|
593
|
+
*/
|
594
|
+
static VALUE
|
595
|
+
ossl_x509_verify(VALUE self, VALUE key)
|
596
|
+
{
|
597
|
+
X509 *x509;
|
598
|
+
EVP_PKEY *pkey;
|
599
|
+
|
600
|
+
pkey = GetPKeyPtr(key); /* NO NEED TO DUP */
|
601
|
+
GetX509(self, x509);
|
602
|
+
|
603
|
+
switch (X509_verify(x509, pkey)) {
|
604
|
+
case 1:
|
605
|
+
return Qtrue;
|
606
|
+
case 0:
|
607
|
+
ossl_clear_error();
|
608
|
+
return Qfalse;
|
609
|
+
default:
|
610
|
+
ossl_raise(eX509CertError, NULL);
|
611
|
+
}
|
612
|
+
}
|
613
|
+
|
614
|
+
/*
|
615
|
+
* call-seq:
|
616
|
+
* cert.check_private_key(key)
|
617
|
+
*
|
618
|
+
* Checks if 'key' is PRIV key for this cert
|
619
|
+
*/
|
620
|
+
static VALUE
|
621
|
+
ossl_x509_check_private_key(VALUE self, VALUE key)
|
622
|
+
{
|
623
|
+
X509 *x509;
|
624
|
+
EVP_PKEY *pkey;
|
625
|
+
|
626
|
+
/* not needed private key, but should be */
|
627
|
+
pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */
|
628
|
+
GetX509(self, x509);
|
629
|
+
if (!X509_check_private_key(x509, pkey)) {
|
630
|
+
OSSL_Warning("Check private key:%s", OSSL_ErrMsg());
|
631
|
+
return Qfalse;
|
632
|
+
}
|
633
|
+
|
634
|
+
return Qtrue;
|
635
|
+
}
|
636
|
+
|
637
|
+
/*
|
638
|
+
* call-seq:
|
639
|
+
* cert.extensions => [extension...]
|
640
|
+
*/
|
641
|
+
static VALUE
|
642
|
+
ossl_x509_get_extensions(VALUE self)
|
643
|
+
{
|
644
|
+
X509 *x509;
|
645
|
+
int count, i;
|
646
|
+
X509_EXTENSION *ext;
|
647
|
+
VALUE ary;
|
648
|
+
|
649
|
+
GetX509(self, x509);
|
650
|
+
count = X509_get_ext_count(x509);
|
651
|
+
if (count < 0) {
|
652
|
+
return rb_ary_new();
|
653
|
+
}
|
654
|
+
ary = rb_ary_new2(count);
|
655
|
+
for (i=0; i<count; i++) {
|
656
|
+
ext = X509_get_ext(x509, i); /* NO DUP - don't free! */
|
657
|
+
rb_ary_push(ary, ossl_x509ext_new(ext));
|
658
|
+
}
|
659
|
+
|
660
|
+
return ary;
|
661
|
+
}
|
662
|
+
|
663
|
+
/*
|
664
|
+
* call-seq:
|
665
|
+
* cert.extensions = [ext...] => [ext...]
|
666
|
+
*/
|
667
|
+
static VALUE
|
668
|
+
ossl_x509_set_extensions(VALUE self, VALUE ary)
|
669
|
+
{
|
670
|
+
X509 *x509;
|
671
|
+
X509_EXTENSION *ext;
|
672
|
+
long i;
|
673
|
+
|
674
|
+
Check_Type(ary, T_ARRAY);
|
675
|
+
/* All ary's members should be X509Extension */
|
676
|
+
for (i=0; i<RARRAY_LEN(ary); i++) {
|
677
|
+
OSSL_Check_Kind(RARRAY_AREF(ary, i), cX509Ext);
|
678
|
+
}
|
679
|
+
GetX509(self, x509);
|
680
|
+
while ((ext = X509_delete_ext(x509, 0)))
|
681
|
+
X509_EXTENSION_free(ext);
|
682
|
+
for (i=0; i<RARRAY_LEN(ary); i++) {
|
683
|
+
ext = GetX509ExtPtr(RARRAY_AREF(ary, i));
|
684
|
+
if (!X509_add_ext(x509, ext, -1)) { /* DUPs ext */
|
685
|
+
ossl_raise(eX509CertError, NULL);
|
686
|
+
}
|
687
|
+
}
|
688
|
+
|
689
|
+
return ary;
|
690
|
+
}
|
691
|
+
|
692
|
+
/*
|
693
|
+
* call-seq:
|
694
|
+
* cert.add_extension(extension) => extension
|
695
|
+
*/
|
696
|
+
static VALUE
|
697
|
+
ossl_x509_add_extension(VALUE self, VALUE extension)
|
698
|
+
{
|
699
|
+
X509 *x509;
|
700
|
+
X509_EXTENSION *ext;
|
701
|
+
|
702
|
+
GetX509(self, x509);
|
703
|
+
ext = GetX509ExtPtr(extension);
|
704
|
+
if (!X509_add_ext(x509, ext, -1)) { /* DUPs ext - FREE it */
|
705
|
+
ossl_raise(eX509CertError, NULL);
|
706
|
+
}
|
707
|
+
|
708
|
+
return extension;
|
709
|
+
}
|
710
|
+
|
711
|
+
static VALUE
|
712
|
+
ossl_x509_inspect(VALUE self)
|
713
|
+
{
|
714
|
+
return rb_sprintf("#<%"PRIsVALUE": subject=%+"PRIsVALUE", "
|
715
|
+
"issuer=%+"PRIsVALUE", serial=%+"PRIsVALUE", "
|
716
|
+
"not_before=%+"PRIsVALUE", not_after=%+"PRIsVALUE">",
|
717
|
+
rb_obj_class(self),
|
718
|
+
ossl_x509_get_subject(self),
|
719
|
+
ossl_x509_get_issuer(self),
|
720
|
+
ossl_x509_get_serial(self),
|
721
|
+
ossl_x509_get_not_before(self),
|
722
|
+
ossl_x509_get_not_after(self));
|
723
|
+
}
|
724
|
+
|
725
|
+
/*
|
726
|
+
* INIT
|
727
|
+
*/
|
728
|
+
void
|
729
|
+
Init_ossl_x509cert(void)
|
730
|
+
{
|
731
|
+
#if 0
|
732
|
+
mOSSL = rb_define_module("OpenSSL");
|
733
|
+
eOSSLError = rb_define_class_under(mOSSL, "OpenSSLError", rb_eStandardError);
|
734
|
+
mX509 = rb_define_module_under(mOSSL, "X509");
|
735
|
+
#endif
|
736
|
+
|
737
|
+
eX509CertError = rb_define_class_under(mX509, "CertificateError", eOSSLError);
|
738
|
+
|
739
|
+
/* Document-class: OpenSSL::X509::Certificate
|
740
|
+
*
|
741
|
+
* Implementation of an X.509 certificate as specified in RFC 5280.
|
742
|
+
* Provides access to a certificate's attributes and allows certificates
|
743
|
+
* to be read from a string, but also supports the creation of new
|
744
|
+
* certificates from scratch.
|
745
|
+
*
|
746
|
+
* === Reading a certificate from a file
|
747
|
+
*
|
748
|
+
* Certificate is capable of handling DER-encoded certificates and
|
749
|
+
* certificates encoded in OpenSSL's PEM format.
|
750
|
+
*
|
751
|
+
* raw = File.read "cert.cer" # DER- or PEM-encoded
|
752
|
+
* certificate = OpenSSL::X509::Certificate.new raw
|
753
|
+
*
|
754
|
+
* === Saving a certificate to a file
|
755
|
+
*
|
756
|
+
* A certificate may be encoded in DER format
|
757
|
+
*
|
758
|
+
* cert = ...
|
759
|
+
* File.open("cert.cer", "wb") { |f| f.print cert.to_der }
|
760
|
+
*
|
761
|
+
* or in PEM format
|
762
|
+
*
|
763
|
+
* cert = ...
|
764
|
+
* File.open("cert.pem", "wb") { |f| f.print cert.to_pem }
|
765
|
+
*
|
766
|
+
* X.509 certificates are associated with a private/public key pair,
|
767
|
+
* typically a RSA, DSA or ECC key (see also OpenSSL::PKey::RSA,
|
768
|
+
* OpenSSL::PKey::DSA and OpenSSL::PKey::EC), the public key itself is
|
769
|
+
* stored within the certificate and can be accessed in form of an
|
770
|
+
* OpenSSL::PKey. Certificates are typically used to be able to associate
|
771
|
+
* some form of identity with a key pair, for example web servers serving
|
772
|
+
* pages over HTTPs use certificates to authenticate themselves to the user.
|
773
|
+
*
|
774
|
+
* The public key infrastructure (PKI) model relies on trusted certificate
|
775
|
+
* authorities ("root CAs") that issue these certificates, so that end
|
776
|
+
* users need to base their trust just on a selected few authorities
|
777
|
+
* that themselves again vouch for subordinate CAs issuing their
|
778
|
+
* certificates to end users.
|
779
|
+
*
|
780
|
+
* The OpenSSL::X509 module provides the tools to set up an independent
|
781
|
+
* PKI, similar to scenarios where the 'openssl' command line tool is
|
782
|
+
* used for issuing certificates in a private PKI.
|
783
|
+
*
|
784
|
+
* === Creating a root CA certificate and an end-entity certificate
|
785
|
+
*
|
786
|
+
* First, we need to create a "self-signed" root certificate. To do so,
|
787
|
+
* we need to generate a key first. Please note that the choice of "1"
|
788
|
+
* as a serial number is considered a security flaw for real certificates.
|
789
|
+
* Secure choices are integers in the two-digit byte range and ideally
|
790
|
+
* not sequential but secure random numbers, steps omitted here to keep
|
791
|
+
* the example concise.
|
792
|
+
*
|
793
|
+
* root_key = OpenSSL::PKey::RSA.new 2048 # the CA's public/private key
|
794
|
+
* root_ca = OpenSSL::X509::Certificate.new
|
795
|
+
* root_ca.version = 2 # cf. RFC 5280 - to make it a "v3" certificate
|
796
|
+
* root_ca.serial = 1
|
797
|
+
* root_ca.subject = OpenSSL::X509::Name.parse "/DC=org/DC=ruby-lang/CN=Ruby CA"
|
798
|
+
* root_ca.issuer = root_ca.subject # root CA's are "self-signed"
|
799
|
+
* root_ca.public_key = root_key.public_key
|
800
|
+
* root_ca.not_before = Time.now
|
801
|
+
* root_ca.not_after = root_ca.not_before + 2 * 365 * 24 * 60 * 60 # 2 years validity
|
802
|
+
* ef = OpenSSL::X509::ExtensionFactory.new
|
803
|
+
* ef.subject_certificate = root_ca
|
804
|
+
* ef.issuer_certificate = root_ca
|
805
|
+
* root_ca.add_extension(ef.create_extension("basicConstraints","CA:TRUE",true))
|
806
|
+
* root_ca.add_extension(ef.create_extension("keyUsage","keyCertSign, cRLSign", true))
|
807
|
+
* root_ca.add_extension(ef.create_extension("subjectKeyIdentifier","hash",false))
|
808
|
+
* root_ca.add_extension(ef.create_extension("authorityKeyIdentifier","keyid:always",false))
|
809
|
+
* root_ca.sign(root_key, OpenSSL::Digest::SHA256.new)
|
810
|
+
*
|
811
|
+
* The next step is to create the end-entity certificate using the root CA
|
812
|
+
* certificate.
|
813
|
+
*
|
814
|
+
* key = OpenSSL::PKey::RSA.new 2048
|
815
|
+
* cert = OpenSSL::X509::Certificate.new
|
816
|
+
* cert.version = 2
|
817
|
+
* cert.serial = 2
|
818
|
+
* cert.subject = OpenSSL::X509::Name.parse "/DC=org/DC=ruby-lang/CN=Ruby certificate"
|
819
|
+
* cert.issuer = root_ca.subject # root CA is the issuer
|
820
|
+
* cert.public_key = key.public_key
|
821
|
+
* cert.not_before = Time.now
|
822
|
+
* cert.not_after = cert.not_before + 1 * 365 * 24 * 60 * 60 # 1 years validity
|
823
|
+
* ef = OpenSSL::X509::ExtensionFactory.new
|
824
|
+
* ef.subject_certificate = cert
|
825
|
+
* ef.issuer_certificate = root_ca
|
826
|
+
* cert.add_extension(ef.create_extension("keyUsage","digitalSignature", true))
|
827
|
+
* cert.add_extension(ef.create_extension("subjectKeyIdentifier","hash",false))
|
828
|
+
* cert.sign(root_key, OpenSSL::Digest::SHA256.new)
|
829
|
+
*
|
830
|
+
*/
|
831
|
+
cX509Cert = rb_define_class_under(mX509, "Certificate", rb_cObject);
|
832
|
+
|
833
|
+
rb_define_alloc_func(cX509Cert, ossl_x509_alloc);
|
834
|
+
rb_define_method(cX509Cert, "initialize", ossl_x509_initialize, -1);
|
835
|
+
rb_define_copy_func(cX509Cert, ossl_x509_copy);
|
836
|
+
|
837
|
+
rb_define_method(cX509Cert, "to_der", ossl_x509_to_der, 0);
|
838
|
+
rb_define_method(cX509Cert, "to_pem", ossl_x509_to_pem, 0);
|
839
|
+
rb_define_alias(cX509Cert, "to_s", "to_pem");
|
840
|
+
rb_define_method(cX509Cert, "to_text", ossl_x509_to_text, 0);
|
841
|
+
rb_define_method(cX509Cert, "version", ossl_x509_get_version, 0);
|
842
|
+
rb_define_method(cX509Cert, "version=", ossl_x509_set_version, 1);
|
843
|
+
rb_define_method(cX509Cert, "signature_algorithm", ossl_x509_get_signature_algorithm, 0);
|
844
|
+
rb_define_method(cX509Cert, "serial", ossl_x509_get_serial, 0);
|
845
|
+
rb_define_method(cX509Cert, "serial=", ossl_x509_set_serial, 1);
|
846
|
+
rb_define_method(cX509Cert, "subject", ossl_x509_get_subject, 0);
|
847
|
+
rb_define_method(cX509Cert, "subject=", ossl_x509_set_subject, 1);
|
848
|
+
rb_define_method(cX509Cert, "issuer", ossl_x509_get_issuer, 0);
|
849
|
+
rb_define_method(cX509Cert, "issuer=", ossl_x509_set_issuer, 1);
|
850
|
+
rb_define_method(cX509Cert, "not_before", ossl_x509_get_not_before, 0);
|
851
|
+
rb_define_method(cX509Cert, "not_before=", ossl_x509_set_not_before, 1);
|
852
|
+
rb_define_method(cX509Cert, "not_after", ossl_x509_get_not_after, 0);
|
853
|
+
rb_define_method(cX509Cert, "not_after=", ossl_x509_set_not_after, 1);
|
854
|
+
rb_define_method(cX509Cert, "public_key", ossl_x509_get_public_key, 0);
|
855
|
+
rb_define_method(cX509Cert, "public_key=", ossl_x509_set_public_key, 1);
|
856
|
+
rb_define_method(cX509Cert, "sign", ossl_x509_sign, 2);
|
857
|
+
rb_define_method(cX509Cert, "verify", ossl_x509_verify, 1);
|
858
|
+
rb_define_method(cX509Cert, "check_private_key", ossl_x509_check_private_key, 1);
|
859
|
+
rb_define_method(cX509Cert, "extensions", ossl_x509_get_extensions, 0);
|
860
|
+
rb_define_method(cX509Cert, "extensions=", ossl_x509_set_extensions, 1);
|
861
|
+
rb_define_method(cX509Cert, "add_extension", ossl_x509_add_extension, 1);
|
862
|
+
rb_define_method(cX509Cert, "inspect", ossl_x509_inspect, 0);
|
863
|
+
}
|