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,1203 @@
|
|
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
|
+
#include <stdarg.h> /* for ossl_raise */
|
12
|
+
|
13
|
+
//TAU
|
14
|
+
//#include <ruby/thread_native.h> /* for OpenSSL < 1.1.0 locks */
|
15
|
+
|
16
|
+
/*
|
17
|
+
* Data Conversion
|
18
|
+
*/
|
19
|
+
#define OSSL_IMPL_ARY2SK(name, type, expected_class, dup) \
|
20
|
+
STACK_OF(type) * \
|
21
|
+
ossl_##name##_ary2sk0(VALUE ary) \
|
22
|
+
{ \
|
23
|
+
STACK_OF(type) *sk; \
|
24
|
+
VALUE val; \
|
25
|
+
type *x; \
|
26
|
+
int i; \
|
27
|
+
\
|
28
|
+
Check_Type(ary, T_ARRAY); \
|
29
|
+
sk = sk_##type##_new_null(); \
|
30
|
+
if (!sk) ossl_raise(eOSSLError, NULL); \
|
31
|
+
\
|
32
|
+
for (i = 0; i < RARRAY_LEN(ary); i++) { \
|
33
|
+
val = rb_ary_entry(ary, i); \
|
34
|
+
if (!rb_obj_is_kind_of(val, expected_class)) { \
|
35
|
+
sk_##type##_pop_free(sk, type##_free); \
|
36
|
+
ossl_raise(eOSSLError, "object in array not" \
|
37
|
+
" of class ##type##"); \
|
38
|
+
} \
|
39
|
+
x = dup(val); /* NEED TO DUP */ \
|
40
|
+
sk_##type##_push(sk, x); \
|
41
|
+
} \
|
42
|
+
return sk; \
|
43
|
+
} \
|
44
|
+
\
|
45
|
+
STACK_OF(type) * \
|
46
|
+
ossl_protect_##name##_ary2sk(VALUE ary, int *status) \
|
47
|
+
{ \
|
48
|
+
return (STACK_OF(type)*)rb_protect( \
|
49
|
+
(VALUE (*)(VALUE))ossl_##name##_ary2sk0, \
|
50
|
+
ary, \
|
51
|
+
status); \
|
52
|
+
} \
|
53
|
+
\
|
54
|
+
STACK_OF(type) * \
|
55
|
+
ossl_##name##_ary2sk(VALUE ary) \
|
56
|
+
{ \
|
57
|
+
STACK_OF(type) *sk; \
|
58
|
+
int status = 0; \
|
59
|
+
\
|
60
|
+
sk = ossl_protect_##name##_ary2sk(ary, &status); \
|
61
|
+
if (status) rb_jump_tag(status); \
|
62
|
+
\
|
63
|
+
return sk; \
|
64
|
+
}
|
65
|
+
OSSL_IMPL_ARY2SK(x509, X509, cX509Cert, DupX509CertPtr)
|
66
|
+
|
67
|
+
#define OSSL_IMPL_SK2ARY(name, type) \
|
68
|
+
VALUE \
|
69
|
+
ossl_##name##_sk2ary(const STACK_OF(type) *sk) \
|
70
|
+
{ \
|
71
|
+
type *t; \
|
72
|
+
int i, num; \
|
73
|
+
VALUE ary; \
|
74
|
+
\
|
75
|
+
if (!sk) { \
|
76
|
+
OSSL_Debug("empty sk!"); \
|
77
|
+
return Qnil; \
|
78
|
+
} \
|
79
|
+
num = sk_##type##_num(sk); \
|
80
|
+
if (num < 0) { \
|
81
|
+
OSSL_Debug("items in sk < -1???"); \
|
82
|
+
return rb_ary_new(); \
|
83
|
+
} \
|
84
|
+
ary = rb_ary_new2(num); \
|
85
|
+
\
|
86
|
+
for (i=0; i<num; i++) { \
|
87
|
+
t = sk_##type##_value(sk, i); \
|
88
|
+
rb_ary_push(ary, ossl_##name##_new(t)); \
|
89
|
+
} \
|
90
|
+
return ary; \
|
91
|
+
}
|
92
|
+
OSSL_IMPL_SK2ARY(x509, X509)
|
93
|
+
OSSL_IMPL_SK2ARY(x509crl, X509_CRL)
|
94
|
+
OSSL_IMPL_SK2ARY(x509name, X509_NAME)
|
95
|
+
|
96
|
+
static VALUE
|
97
|
+
ossl_str_new(int size)
|
98
|
+
{
|
99
|
+
return rb_str_new(0, size);
|
100
|
+
}
|
101
|
+
|
102
|
+
VALUE
|
103
|
+
ossl_buf2str(char *buf, int len)
|
104
|
+
{
|
105
|
+
VALUE str;
|
106
|
+
int status = 0;
|
107
|
+
|
108
|
+
str = rb_protect((VALUE (*)(VALUE))ossl_str_new, len, &status);
|
109
|
+
if(!NIL_P(str)) memcpy(RSTRING_PTR(str), buf, len);
|
110
|
+
OPENSSL_free(buf);
|
111
|
+
if(status) rb_jump_tag(status);
|
112
|
+
|
113
|
+
return str;
|
114
|
+
}
|
115
|
+
|
116
|
+
void
|
117
|
+
ossl_bin2hex(unsigned char *in, char *out, size_t inlen)
|
118
|
+
{
|
119
|
+
const char *hex = "0123456789abcdef";
|
120
|
+
size_t i;
|
121
|
+
|
122
|
+
assert(inlen <= LONG_MAX / 2);
|
123
|
+
for (i = 0; i < inlen; i++) {
|
124
|
+
unsigned char p = in[i];
|
125
|
+
|
126
|
+
out[i * 2 + 0] = hex[p >> 4];
|
127
|
+
out[i * 2 + 1] = hex[p & 0x0f];
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
/*
|
132
|
+
* our default PEM callback
|
133
|
+
*/
|
134
|
+
|
135
|
+
/*
|
136
|
+
* OpenSSL requires passwords for PEM-encoded files to be at least four
|
137
|
+
* characters long. See crypto/pem/pem_lib.c (as of 1.0.2h)
|
138
|
+
*/
|
139
|
+
#define OSSL_MIN_PWD_LEN 4
|
140
|
+
|
141
|
+
VALUE
|
142
|
+
ossl_pem_passwd_value(VALUE pass)
|
143
|
+
{
|
144
|
+
if (NIL_P(pass))
|
145
|
+
return Qnil;
|
146
|
+
|
147
|
+
StringValue(pass);
|
148
|
+
|
149
|
+
if (RSTRING_LEN(pass) < OSSL_MIN_PWD_LEN)
|
150
|
+
ossl_raise(eOSSLError, "password must be at least %d bytes", OSSL_MIN_PWD_LEN);
|
151
|
+
/* PEM_BUFSIZE is currently used as the second argument of pem_password_cb,
|
152
|
+
* that is +max_len+ of ossl_pem_passwd_cb() */
|
153
|
+
if (RSTRING_LEN(pass) > PEM_BUFSIZE)
|
154
|
+
ossl_raise(eOSSLError, "password must be shorter than %d bytes", PEM_BUFSIZE);
|
155
|
+
|
156
|
+
return pass;
|
157
|
+
}
|
158
|
+
|
159
|
+
static VALUE
|
160
|
+
ossl_pem_passwd_cb0(VALUE flag)
|
161
|
+
{
|
162
|
+
VALUE pass;
|
163
|
+
|
164
|
+
pass = rb_yield(flag);
|
165
|
+
SafeStringValue(pass);
|
166
|
+
|
167
|
+
return pass;
|
168
|
+
}
|
169
|
+
|
170
|
+
int
|
171
|
+
ossl_pem_passwd_cb(char *buf, int max_len, int flag, void *pwd_)
|
172
|
+
{
|
173
|
+
int len, status;
|
174
|
+
VALUE rflag, pass = (VALUE)pwd_;
|
175
|
+
|
176
|
+
if (RTEST(pass)) {
|
177
|
+
/* PEM_def_callback(buf, max_len, flag, StringValueCStr(pass)) does not
|
178
|
+
* work because it does not allow NUL characters and truncates to 1024
|
179
|
+
* bytes silently if the input is over 1024 bytes */
|
180
|
+
if (RB_TYPE_P(pass, T_STRING)) {
|
181
|
+
len = RSTRING_LENINT(pass);
|
182
|
+
if (len >= OSSL_MIN_PWD_LEN && len <= max_len) {
|
183
|
+
memcpy(buf, RSTRING_PTR(pass), len);
|
184
|
+
return len;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
OSSL_Debug("passed data is not valid String???");
|
188
|
+
return -1;
|
189
|
+
}
|
190
|
+
|
191
|
+
if (!rb_block_given_p()) {
|
192
|
+
return PEM_def_callback(buf, max_len, flag, NULL);
|
193
|
+
}
|
194
|
+
|
195
|
+
while (1) {
|
196
|
+
/*
|
197
|
+
* when the flag is nonzero, this passphrase
|
198
|
+
* will be used to perform encryption; otherwise it will
|
199
|
+
* be used to perform decryption.
|
200
|
+
*/
|
201
|
+
rflag = flag ? Qtrue : Qfalse;
|
202
|
+
pass = rb_protect(ossl_pem_passwd_cb0, rflag, &status);
|
203
|
+
if (status) {
|
204
|
+
/* ignore an exception raised. */
|
205
|
+
rb_set_errinfo(Qnil);
|
206
|
+
return -1;
|
207
|
+
}
|
208
|
+
len = RSTRING_LENINT(pass);
|
209
|
+
if (len < OSSL_MIN_PWD_LEN) {
|
210
|
+
rb_warning("password must be at least %d bytes", OSSL_MIN_PWD_LEN);
|
211
|
+
continue;
|
212
|
+
}
|
213
|
+
if (len > max_len) {
|
214
|
+
rb_warning("password must be shorter than %d bytes", max_len);
|
215
|
+
continue;
|
216
|
+
}
|
217
|
+
memcpy(buf, RSTRING_PTR(pass), len);
|
218
|
+
break;
|
219
|
+
}
|
220
|
+
return len;
|
221
|
+
}
|
222
|
+
|
223
|
+
/*
|
224
|
+
* Verify callback
|
225
|
+
*/
|
226
|
+
int ossl_store_ctx_ex_verify_cb_idx;
|
227
|
+
int ossl_store_ex_verify_cb_idx;
|
228
|
+
|
229
|
+
struct ossl_verify_cb_args {
|
230
|
+
VALUE proc;
|
231
|
+
VALUE preverify_ok;
|
232
|
+
VALUE store_ctx;
|
233
|
+
};
|
234
|
+
|
235
|
+
static VALUE
|
236
|
+
ossl_call_verify_cb_proc(struct ossl_verify_cb_args *args)
|
237
|
+
{
|
238
|
+
return rb_funcall(args->proc, rb_intern("call"), 2,
|
239
|
+
args->preverify_ok, args->store_ctx);
|
240
|
+
}
|
241
|
+
|
242
|
+
int
|
243
|
+
ossl_verify_cb_call(VALUE proc, int ok, X509_STORE_CTX *ctx)
|
244
|
+
{
|
245
|
+
VALUE rctx, ret;
|
246
|
+
struct ossl_verify_cb_args args;
|
247
|
+
int state;
|
248
|
+
|
249
|
+
if (NIL_P(proc))
|
250
|
+
return ok;
|
251
|
+
|
252
|
+
ret = Qfalse;
|
253
|
+
rctx = rb_protect((VALUE(*)(VALUE))ossl_x509stctx_new, (VALUE)ctx, &state);
|
254
|
+
if (state) {
|
255
|
+
rb_set_errinfo(Qnil);
|
256
|
+
rb_warn("StoreContext initialization failure");
|
257
|
+
}
|
258
|
+
else {
|
259
|
+
args.proc = proc;
|
260
|
+
args.preverify_ok = ok ? Qtrue : Qfalse;
|
261
|
+
args.store_ctx = rctx;
|
262
|
+
ret = rb_protect((VALUE(*)(VALUE))ossl_call_verify_cb_proc, (VALUE)&args, &state);
|
263
|
+
if (state) {
|
264
|
+
rb_set_errinfo(Qnil);
|
265
|
+
rb_warn("exception in verify_callback is ignored");
|
266
|
+
}
|
267
|
+
ossl_x509stctx_clear_ptr(rctx);
|
268
|
+
}
|
269
|
+
if (ret == Qtrue) {
|
270
|
+
X509_STORE_CTX_set_error(ctx, X509_V_OK);
|
271
|
+
ok = 1;
|
272
|
+
}
|
273
|
+
else {
|
274
|
+
if (X509_STORE_CTX_get_error(ctx) == X509_V_OK)
|
275
|
+
X509_STORE_CTX_set_error(ctx, X509_V_ERR_CERT_REJECTED);
|
276
|
+
ok = 0;
|
277
|
+
}
|
278
|
+
|
279
|
+
return ok;
|
280
|
+
}
|
281
|
+
|
282
|
+
/*
|
283
|
+
* main module
|
284
|
+
*/
|
285
|
+
VALUE mOSSL;
|
286
|
+
|
287
|
+
/*
|
288
|
+
* OpenSSLError < StandardError
|
289
|
+
*/
|
290
|
+
VALUE eOSSLError;
|
291
|
+
|
292
|
+
/*
|
293
|
+
* Convert to DER string
|
294
|
+
*/
|
295
|
+
ID ossl_s_to_der;
|
296
|
+
|
297
|
+
VALUE
|
298
|
+
ossl_to_der(VALUE obj)
|
299
|
+
{
|
300
|
+
VALUE tmp;
|
301
|
+
|
302
|
+
tmp = rb_funcall(obj, ossl_s_to_der, 0);
|
303
|
+
StringValue(tmp);
|
304
|
+
|
305
|
+
return tmp;
|
306
|
+
}
|
307
|
+
|
308
|
+
VALUE
|
309
|
+
ossl_to_der_if_possible(VALUE obj)
|
310
|
+
{
|
311
|
+
if(rb_respond_to(obj, ossl_s_to_der))
|
312
|
+
return ossl_to_der(obj);
|
313
|
+
return obj;
|
314
|
+
}
|
315
|
+
|
316
|
+
/*
|
317
|
+
* Errors
|
318
|
+
*/
|
319
|
+
static VALUE
|
320
|
+
ossl_make_error(VALUE exc, const char *fmt, va_list args)
|
321
|
+
{
|
322
|
+
VALUE str = Qnil;
|
323
|
+
const char *msg;
|
324
|
+
long e;
|
325
|
+
|
326
|
+
e = ERR_peek_last_error();
|
327
|
+
if (fmt) {
|
328
|
+
str = rb_vsprintf(fmt, args);
|
329
|
+
}
|
330
|
+
if (e) {
|
331
|
+
if (dOSSL == Qtrue) /* FULL INFO */
|
332
|
+
msg = ERR_error_string(e, NULL);
|
333
|
+
else
|
334
|
+
msg = ERR_reason_error_string(e);
|
335
|
+
if (NIL_P(str)) {
|
336
|
+
if (msg) str = rb_str_new_cstr(msg);
|
337
|
+
}
|
338
|
+
else {
|
339
|
+
if (RSTRING_LEN(str)) rb_str_cat2(str, ": ");
|
340
|
+
rb_str_cat2(str, msg ? msg : "(null)");
|
341
|
+
}
|
342
|
+
}
|
343
|
+
ossl_clear_error();
|
344
|
+
|
345
|
+
if (NIL_P(str)) str = rb_str_new(0, 0);
|
346
|
+
return rb_exc_new3(exc, str);
|
347
|
+
}
|
348
|
+
|
349
|
+
void
|
350
|
+
ossl_raise(VALUE exc, const char *fmt, ...)
|
351
|
+
{
|
352
|
+
va_list args;
|
353
|
+
VALUE err;
|
354
|
+
va_start(args, fmt);
|
355
|
+
err = ossl_make_error(exc, fmt, args);
|
356
|
+
va_end(args);
|
357
|
+
rb_exc_raise(err);
|
358
|
+
}
|
359
|
+
|
360
|
+
VALUE
|
361
|
+
ossl_exc_new(VALUE exc, const char *fmt, ...)
|
362
|
+
{
|
363
|
+
va_list args;
|
364
|
+
VALUE err;
|
365
|
+
va_start(args, fmt);
|
366
|
+
err = ossl_make_error(exc, fmt, args);
|
367
|
+
va_end(args);
|
368
|
+
return err;
|
369
|
+
}
|
370
|
+
|
371
|
+
void
|
372
|
+
ossl_clear_error(void)
|
373
|
+
{
|
374
|
+
if (dOSSL == Qtrue) {
|
375
|
+
long e;
|
376
|
+
while ((e = ERR_get_error())) {
|
377
|
+
rb_warn("error on stack: %s", ERR_error_string(e, NULL));
|
378
|
+
}
|
379
|
+
}
|
380
|
+
ERR_clear_error();
|
381
|
+
}
|
382
|
+
|
383
|
+
/*
|
384
|
+
* call-seq:
|
385
|
+
* OpenSSL.errors -> [String...]
|
386
|
+
*
|
387
|
+
* See any remaining errors held in queue.
|
388
|
+
*
|
389
|
+
* Any errors you see here are probably due to a bug in ruby's OpenSSL implementation.
|
390
|
+
*/
|
391
|
+
VALUE
|
392
|
+
ossl_get_errors(void)
|
393
|
+
{
|
394
|
+
VALUE ary;
|
395
|
+
long e;
|
396
|
+
|
397
|
+
ary = rb_ary_new();
|
398
|
+
while ((e = ERR_get_error()) != 0){
|
399
|
+
rb_ary_push(ary, rb_str_new2(ERR_error_string(e, NULL)));
|
400
|
+
}
|
401
|
+
|
402
|
+
return ary;
|
403
|
+
}
|
404
|
+
|
405
|
+
/*
|
406
|
+
* Debug
|
407
|
+
*/
|
408
|
+
VALUE dOSSL;
|
409
|
+
|
410
|
+
#if !defined(HAVE_VA_ARGS_MACRO)
|
411
|
+
void
|
412
|
+
ossl_debug(const char *fmt, ...)
|
413
|
+
{
|
414
|
+
va_list args;
|
415
|
+
|
416
|
+
if (dOSSL == Qtrue) {
|
417
|
+
fprintf(stderr, "OSSL_DEBUG: ");
|
418
|
+
va_start(args, fmt);
|
419
|
+
vfprintf(stderr, fmt, args);
|
420
|
+
va_end(args);
|
421
|
+
fprintf(stderr, " [CONTEXT N/A]\n");
|
422
|
+
}
|
423
|
+
}
|
424
|
+
#endif
|
425
|
+
|
426
|
+
/*
|
427
|
+
* call-seq:
|
428
|
+
* OpenSSL.debug -> true | false
|
429
|
+
*/
|
430
|
+
static VALUE
|
431
|
+
ossl_debug_get(VALUE self)
|
432
|
+
{
|
433
|
+
return dOSSL;
|
434
|
+
}
|
435
|
+
|
436
|
+
/*
|
437
|
+
* call-seq:
|
438
|
+
* OpenSSL.debug = boolean -> boolean
|
439
|
+
*
|
440
|
+
* Turns on or off debug mode. With debug mode, all erros added to the OpenSSL
|
441
|
+
* error queue will be printed to stderr.
|
442
|
+
*/
|
443
|
+
static VALUE
|
444
|
+
ossl_debug_set(VALUE self, VALUE val)
|
445
|
+
{
|
446
|
+
dOSSL = RTEST(val) ? Qtrue : Qfalse;
|
447
|
+
|
448
|
+
return val;
|
449
|
+
}
|
450
|
+
|
451
|
+
/*
|
452
|
+
* call-seq:
|
453
|
+
* OpenSSL.fips_mode = boolean -> boolean
|
454
|
+
*
|
455
|
+
* Turns FIPS mode on or off. Turning on FIPS mode will obviously only have an
|
456
|
+
* effect for FIPS-capable installations of the OpenSSL library. Trying to do
|
457
|
+
* so otherwise will result in an error.
|
458
|
+
*
|
459
|
+
* === Examples
|
460
|
+
* OpenSSL.fips_mode = true # turn FIPS mode on
|
461
|
+
* OpenSSL.fips_mode = false # and off again
|
462
|
+
*/
|
463
|
+
static VALUE
|
464
|
+
ossl_fips_mode_set(VALUE self, VALUE enabled)
|
465
|
+
{
|
466
|
+
|
467
|
+
#ifdef OPENSSL_FIPS
|
468
|
+
if (RTEST(enabled)) {
|
469
|
+
int mode = FIPS_mode();
|
470
|
+
if(!mode && !FIPS_mode_set(1)) /* turning on twice leads to an error */
|
471
|
+
ossl_raise(eOSSLError, "Turning on FIPS mode failed");
|
472
|
+
} else {
|
473
|
+
if(!FIPS_mode_set(0)) /* turning off twice is OK */
|
474
|
+
ossl_raise(eOSSLError, "Turning off FIPS mode failed");
|
475
|
+
}
|
476
|
+
return enabled;
|
477
|
+
#else
|
478
|
+
if (RTEST(enabled))
|
479
|
+
ossl_raise(eOSSLError, "This version of OpenSSL does not support FIPS mode");
|
480
|
+
return enabled;
|
481
|
+
#endif
|
482
|
+
}
|
483
|
+
|
484
|
+
#if !defined(HAVE_OPENSSL_110_THREADING_API)
|
485
|
+
/**
|
486
|
+
* Stores locks needed for OpenSSL thread safety
|
487
|
+
*/
|
488
|
+
static rb_nativethread_lock_t *ossl_locks;
|
489
|
+
|
490
|
+
static void
|
491
|
+
ossl_lock_unlock(int mode, rb_nativethread_lock_t *lock)
|
492
|
+
{
|
493
|
+
if (mode & CRYPTO_LOCK) {
|
494
|
+
rb_nativethread_lock_lock(lock);
|
495
|
+
} else {
|
496
|
+
rb_nativethread_lock_unlock(lock);
|
497
|
+
}
|
498
|
+
}
|
499
|
+
|
500
|
+
static void
|
501
|
+
ossl_lock_callback(int mode, int type, const char *file, int line)
|
502
|
+
{
|
503
|
+
ossl_lock_unlock(mode, &ossl_locks[type]);
|
504
|
+
}
|
505
|
+
|
506
|
+
struct CRYPTO_dynlock_value {
|
507
|
+
rb_nativethread_lock_t lock;
|
508
|
+
};
|
509
|
+
|
510
|
+
static struct CRYPTO_dynlock_value *
|
511
|
+
ossl_dyn_create_callback(const char *file, int line)
|
512
|
+
{
|
513
|
+
struct CRYPTO_dynlock_value *dynlock = (struct CRYPTO_dynlock_value *)OPENSSL_malloc((int)sizeof(struct CRYPTO_dynlock_value));
|
514
|
+
rb_nativethread_lock_initialize(&dynlock->lock);
|
515
|
+
return dynlock;
|
516
|
+
}
|
517
|
+
|
518
|
+
static void
|
519
|
+
ossl_dyn_lock_callback(int mode, struct CRYPTO_dynlock_value *l, const char *file, int line)
|
520
|
+
{
|
521
|
+
ossl_lock_unlock(mode, &l->lock);
|
522
|
+
}
|
523
|
+
|
524
|
+
static void
|
525
|
+
ossl_dyn_destroy_callback(struct CRYPTO_dynlock_value *l, const char *file, int line)
|
526
|
+
{
|
527
|
+
rb_nativethread_lock_destroy(&l->lock);
|
528
|
+
OPENSSL_free(l);
|
529
|
+
}
|
530
|
+
|
531
|
+
#ifdef HAVE_CRYPTO_THREADID_PTR
|
532
|
+
static void ossl_threadid_func(CRYPTO_THREADID *id)
|
533
|
+
{
|
534
|
+
/* register native thread id */
|
535
|
+
CRYPTO_THREADID_set_pointer(id, (void *)rb_nativethread_self());
|
536
|
+
}
|
537
|
+
#else
|
538
|
+
static unsigned long ossl_thread_id(void)
|
539
|
+
{
|
540
|
+
/* before OpenSSL 1.0, this is 'unsigned long' */
|
541
|
+
return (unsigned long)rb_nativethread_self();
|
542
|
+
}
|
543
|
+
#endif
|
544
|
+
|
545
|
+
static void Init_ossl_locks(void)
|
546
|
+
{
|
547
|
+
int i;
|
548
|
+
int num_locks = CRYPTO_num_locks();
|
549
|
+
|
550
|
+
if ((unsigned)num_locks >= INT_MAX / (int)sizeof(VALUE)) {
|
551
|
+
rb_raise(rb_eRuntimeError, "CRYPTO_num_locks() is too big: %d", num_locks);
|
552
|
+
}
|
553
|
+
ossl_locks = (rb_nativethread_lock_t *) OPENSSL_malloc(num_locks * (int)sizeof(rb_nativethread_lock_t));
|
554
|
+
if (!ossl_locks) {
|
555
|
+
rb_raise(rb_eNoMemError, "CRYPTO_num_locks() is too big: %d", num_locks);
|
556
|
+
}
|
557
|
+
for (i = 0; i < num_locks; i++) {
|
558
|
+
rb_nativethread_lock_initialize(&ossl_locks[i]);
|
559
|
+
}
|
560
|
+
|
561
|
+
#ifdef HAVE_CRYPTO_THREADID_PTR
|
562
|
+
CRYPTO_THREADID_set_callback(ossl_threadid_func);
|
563
|
+
#else
|
564
|
+
CRYPTO_set_id_callback(ossl_thread_id);
|
565
|
+
#endif
|
566
|
+
CRYPTO_set_locking_callback(ossl_lock_callback);
|
567
|
+
CRYPTO_set_dynlock_create_callback(ossl_dyn_create_callback);
|
568
|
+
CRYPTO_set_dynlock_lock_callback(ossl_dyn_lock_callback);
|
569
|
+
CRYPTO_set_dynlock_destroy_callback(ossl_dyn_destroy_callback);
|
570
|
+
}
|
571
|
+
#endif /* !HAVE_OPENSSL_110_THREADING_API */
|
572
|
+
|
573
|
+
/*
|
574
|
+
* OpenSSL provides SSL, TLS and general purpose cryptography. It wraps the
|
575
|
+
* OpenSSL[http://www.openssl.org/] library.
|
576
|
+
*
|
577
|
+
* = Examples
|
578
|
+
*
|
579
|
+
* All examples assume you have loaded OpenSSL with:
|
580
|
+
*
|
581
|
+
* require 'openssl'
|
582
|
+
*
|
583
|
+
* These examples build atop each other. For example the key created in the
|
584
|
+
* next is used in throughout these examples.
|
585
|
+
*
|
586
|
+
* == Keys
|
587
|
+
*
|
588
|
+
* === Creating a Key
|
589
|
+
*
|
590
|
+
* This example creates a 2048 bit RSA keypair and writes it to the current
|
591
|
+
* directory.
|
592
|
+
*
|
593
|
+
* key = OpenSSL::PKey::RSA.new 2048
|
594
|
+
*
|
595
|
+
* open 'private_key.pem', 'w' do |io| io.write key.to_pem end
|
596
|
+
* open 'public_key.pem', 'w' do |io| io.write key.public_key.to_pem end
|
597
|
+
*
|
598
|
+
* === Exporting a Key
|
599
|
+
*
|
600
|
+
* Keys saved to disk without encryption are not secure as anyone who gets
|
601
|
+
* ahold of the key may use it unless it is encrypted. In order to securely
|
602
|
+
* export a key you may export it with a pass phrase.
|
603
|
+
*
|
604
|
+
* cipher = OpenSSL::Cipher.new 'AES-128-CBC'
|
605
|
+
* pass_phrase = 'my secure pass phrase goes here'
|
606
|
+
*
|
607
|
+
* key_secure = key.export cipher, pass_phrase
|
608
|
+
*
|
609
|
+
* open 'private.secure.pem', 'w' do |io|
|
610
|
+
* io.write key_secure
|
611
|
+
* end
|
612
|
+
*
|
613
|
+
* OpenSSL::Cipher.ciphers returns a list of available ciphers.
|
614
|
+
*
|
615
|
+
* === Loading a Key
|
616
|
+
*
|
617
|
+
* A key can also be loaded from a file.
|
618
|
+
*
|
619
|
+
* key2 = OpenSSL::PKey::RSA.new File.read 'private_key.pem'
|
620
|
+
* key2.public? # => true
|
621
|
+
* key2.private? # => true
|
622
|
+
*
|
623
|
+
* or
|
624
|
+
*
|
625
|
+
* key3 = OpenSSL::PKey::RSA.new File.read 'public_key.pem'
|
626
|
+
* key3.public? # => true
|
627
|
+
* key3.private? # => false
|
628
|
+
*
|
629
|
+
* === Loading an Encrypted Key
|
630
|
+
*
|
631
|
+
* OpenSSL will prompt you for your pass phrase when loading an encrypted key.
|
632
|
+
* If you will not be able to type in the pass phrase you may provide it when
|
633
|
+
* loading the key:
|
634
|
+
*
|
635
|
+
* key4_pem = File.read 'private.secure.pem'
|
636
|
+
* pass_phrase = 'my secure pass phrase goes here'
|
637
|
+
* key4 = OpenSSL::PKey::RSA.new key4_pem, pass_phrase
|
638
|
+
*
|
639
|
+
* == RSA Encryption
|
640
|
+
*
|
641
|
+
* RSA provides encryption and decryption using the public and private keys.
|
642
|
+
* You can use a variety of padding methods depending upon the intended use of
|
643
|
+
* encrypted data.
|
644
|
+
*
|
645
|
+
* === Encryption & Decryption
|
646
|
+
*
|
647
|
+
* Asymmetric public/private key encryption is slow and victim to attack in
|
648
|
+
* cases where it is used without padding or directly to encrypt larger chunks
|
649
|
+
* of data. Typical use cases for RSA encryption involve "wrapping" a symmetric
|
650
|
+
* key with the public key of the recipient who would "unwrap" that symmetric
|
651
|
+
* key again using their private key.
|
652
|
+
* The following illustrates a simplified example of such a key transport
|
653
|
+
* scheme. It shouldn't be used in practice, though, standardized protocols
|
654
|
+
* should always be preferred.
|
655
|
+
*
|
656
|
+
* wrapped_key = key.public_encrypt key
|
657
|
+
*
|
658
|
+
* A symmetric key encrypted with the public key can only be decrypted with
|
659
|
+
* the corresponding private key of the recipient.
|
660
|
+
*
|
661
|
+
* original_key = key.private_decrypt wrapped_key
|
662
|
+
*
|
663
|
+
* By default PKCS#1 padding will be used, but it is also possible to use
|
664
|
+
* other forms of padding, see PKey::RSA for further details.
|
665
|
+
*
|
666
|
+
* === Signatures
|
667
|
+
*
|
668
|
+
* Using "private_encrypt" to encrypt some data with the private key is
|
669
|
+
* equivalent to applying a digital signature to the data. A verifying
|
670
|
+
* party may validate the signature by comparing the result of decrypting
|
671
|
+
* the signature with "public_decrypt" to the original data. However,
|
672
|
+
* OpenSSL::PKey already has methods "sign" and "verify" that handle
|
673
|
+
* digital signatures in a standardized way - "private_encrypt" and
|
674
|
+
* "public_decrypt" shouldn't be used in practice.
|
675
|
+
*
|
676
|
+
* To sign a document, a cryptographically secure hash of the document is
|
677
|
+
* computed first, which is then signed using the private key.
|
678
|
+
*
|
679
|
+
* digest = OpenSSL::Digest::SHA256.new
|
680
|
+
* signature = key.sign digest, document
|
681
|
+
*
|
682
|
+
* To validate the signature, again a hash of the document is computed and
|
683
|
+
* the signature is decrypted using the public key. The result is then
|
684
|
+
* compared to the hash just computed, if they are equal the signature was
|
685
|
+
* valid.
|
686
|
+
*
|
687
|
+
* digest = OpenSSL::Digest::SHA256.new
|
688
|
+
* if key.verify digest, signature, document
|
689
|
+
* puts 'Valid'
|
690
|
+
* else
|
691
|
+
* puts 'Invalid'
|
692
|
+
* end
|
693
|
+
*
|
694
|
+
* == PBKDF2 Password-based Encryption
|
695
|
+
*
|
696
|
+
* If supported by the underlying OpenSSL version used, Password-based
|
697
|
+
* Encryption should use the features of PKCS5. If not supported or if
|
698
|
+
* required by legacy applications, the older, less secure methods specified
|
699
|
+
* in RFC 2898 are also supported (see below).
|
700
|
+
*
|
701
|
+
* PKCS5 supports PBKDF2 as it was specified in PKCS#5
|
702
|
+
* v2.0[http://www.rsa.com/rsalabs/node.asp?id=2127]. It still uses a
|
703
|
+
* password, a salt, and additionally a number of iterations that will
|
704
|
+
* slow the key derivation process down. The slower this is, the more work
|
705
|
+
* it requires being able to brute-force the resulting key.
|
706
|
+
*
|
707
|
+
* === Encryption
|
708
|
+
*
|
709
|
+
* The strategy is to first instantiate a Cipher for encryption, and
|
710
|
+
* then to generate a random IV plus a key derived from the password
|
711
|
+
* using PBKDF2. PKCS #5 v2.0 recommends at least 8 bytes for the salt,
|
712
|
+
* the number of iterations largely depends on the hardware being used.
|
713
|
+
*
|
714
|
+
* cipher = OpenSSL::Cipher.new 'AES-128-CBC'
|
715
|
+
* cipher.encrypt
|
716
|
+
* iv = cipher.random_iv
|
717
|
+
*
|
718
|
+
* pwd = 'some hopefully not to easily guessable password'
|
719
|
+
* salt = OpenSSL::Random.random_bytes 16
|
720
|
+
* iter = 20000
|
721
|
+
* key_len = cipher.key_len
|
722
|
+
* digest = OpenSSL::Digest::SHA256.new
|
723
|
+
*
|
724
|
+
* key = OpenSSL::PKCS5.pbkdf2_hmac(pwd, salt, iter, key_len, digest)
|
725
|
+
* cipher.key = key
|
726
|
+
*
|
727
|
+
* Now encrypt the data:
|
728
|
+
*
|
729
|
+
* encrypted = cipher.update document
|
730
|
+
* encrypted << cipher.final
|
731
|
+
*
|
732
|
+
* === Decryption
|
733
|
+
*
|
734
|
+
* Use the same steps as before to derive the symmetric AES key, this time
|
735
|
+
* setting the Cipher up for decryption.
|
736
|
+
*
|
737
|
+
* cipher = OpenSSL::Cipher.new 'AES-128-CBC'
|
738
|
+
* cipher.decrypt
|
739
|
+
* cipher.iv = iv # the one generated with #random_iv
|
740
|
+
*
|
741
|
+
* pwd = 'some hopefully not to easily guessable password'
|
742
|
+
* salt = ... # the one generated above
|
743
|
+
* iter = 20000
|
744
|
+
* key_len = cipher.key_len
|
745
|
+
* digest = OpenSSL::Digest::SHA256.new
|
746
|
+
*
|
747
|
+
* key = OpenSSL::PKCS5.pbkdf2_hmac(pwd, salt, iter, key_len, digest)
|
748
|
+
* cipher.key = key
|
749
|
+
*
|
750
|
+
* Now decrypt the data:
|
751
|
+
*
|
752
|
+
* decrypted = cipher.update encrypted
|
753
|
+
* decrypted << cipher.final
|
754
|
+
*
|
755
|
+
* == PKCS #5 Password-based Encryption
|
756
|
+
*
|
757
|
+
* PKCS #5 is a password-based encryption standard documented at
|
758
|
+
* RFC2898[http://www.ietf.org/rfc/rfc2898.txt]. It allows a short password or
|
759
|
+
* passphrase to be used to create a secure encryption key. If possible, PBKDF2
|
760
|
+
* as described above should be used if the circumstances allow it.
|
761
|
+
*
|
762
|
+
* PKCS #5 uses a Cipher, a pass phrase and a salt to generate an encryption
|
763
|
+
* key.
|
764
|
+
*
|
765
|
+
* pass_phrase = 'my secure pass phrase goes here'
|
766
|
+
* salt = '8 octets'
|
767
|
+
*
|
768
|
+
* === Encryption
|
769
|
+
*
|
770
|
+
* First set up the cipher for encryption
|
771
|
+
*
|
772
|
+
* encryptor = OpenSSL::Cipher.new 'AES-128-CBC'
|
773
|
+
* encryptor.encrypt
|
774
|
+
* encryptor.pkcs5_keyivgen pass_phrase, salt
|
775
|
+
*
|
776
|
+
* Then pass the data you want to encrypt through
|
777
|
+
*
|
778
|
+
* encrypted = encryptor.update 'top secret document'
|
779
|
+
* encrypted << encryptor.final
|
780
|
+
*
|
781
|
+
* === Decryption
|
782
|
+
*
|
783
|
+
* Use a new Cipher instance set up for decryption
|
784
|
+
*
|
785
|
+
* decryptor = OpenSSL::Cipher.new 'AES-128-CBC'
|
786
|
+
* decryptor.decrypt
|
787
|
+
* decryptor.pkcs5_keyivgen pass_phrase, salt
|
788
|
+
*
|
789
|
+
* Then pass the data you want to decrypt through
|
790
|
+
*
|
791
|
+
* plain = decryptor.update encrypted
|
792
|
+
* plain << decryptor.final
|
793
|
+
*
|
794
|
+
* == X509 Certificates
|
795
|
+
*
|
796
|
+
* === Creating a Certificate
|
797
|
+
*
|
798
|
+
* This example creates a self-signed certificate using an RSA key and a SHA1
|
799
|
+
* signature.
|
800
|
+
*
|
801
|
+
* key = OpenSSL::PKey::RSA.new 2048
|
802
|
+
* name = OpenSSL::X509::Name.parse 'CN=nobody/DC=example'
|
803
|
+
*
|
804
|
+
* cert = OpenSSL::X509::Certificate.new
|
805
|
+
* cert.version = 2
|
806
|
+
* cert.serial = 0
|
807
|
+
* cert.not_before = Time.now
|
808
|
+
* cert.not_after = Time.now + 3600
|
809
|
+
*
|
810
|
+
* cert.public_key = key.public_key
|
811
|
+
* cert.subject = name
|
812
|
+
*
|
813
|
+
* === Certificate Extensions
|
814
|
+
*
|
815
|
+
* You can add extensions to the certificate with
|
816
|
+
* OpenSSL::SSL::ExtensionFactory to indicate the purpose of the certificate.
|
817
|
+
*
|
818
|
+
* extension_factory = OpenSSL::X509::ExtensionFactory.new nil, cert
|
819
|
+
*
|
820
|
+
* cert.add_extension \
|
821
|
+
* extension_factory.create_extension('basicConstraints', 'CA:FALSE', true)
|
822
|
+
*
|
823
|
+
* cert.add_extension \
|
824
|
+
* extension_factory.create_extension(
|
825
|
+
* 'keyUsage', 'keyEncipherment,dataEncipherment,digitalSignature')
|
826
|
+
*
|
827
|
+
* cert.add_extension \
|
828
|
+
* extension_factory.create_extension('subjectKeyIdentifier', 'hash')
|
829
|
+
*
|
830
|
+
* The list of supported extensions (and in some cases their possible values)
|
831
|
+
* can be derived from the "objects.h" file in the OpenSSL source code.
|
832
|
+
*
|
833
|
+
* === Signing a Certificate
|
834
|
+
*
|
835
|
+
* To sign a certificate set the issuer and use OpenSSL::X509::Certificate#sign
|
836
|
+
* with a digest algorithm. This creates a self-signed cert because we're using
|
837
|
+
* the same name and key to sign the certificate as was used to create the
|
838
|
+
* certificate.
|
839
|
+
*
|
840
|
+
* cert.issuer = name
|
841
|
+
* cert.sign key, OpenSSL::Digest::SHA1.new
|
842
|
+
*
|
843
|
+
* open 'certificate.pem', 'w' do |io| io.write cert.to_pem end
|
844
|
+
*
|
845
|
+
* === Loading a Certificate
|
846
|
+
*
|
847
|
+
* Like a key, a cert can also be loaded from a file.
|
848
|
+
*
|
849
|
+
* cert2 = OpenSSL::X509::Certificate.new File.read 'certificate.pem'
|
850
|
+
*
|
851
|
+
* === Verifying a Certificate
|
852
|
+
*
|
853
|
+
* Certificate#verify will return true when a certificate was signed with the
|
854
|
+
* given public key.
|
855
|
+
*
|
856
|
+
* raise 'certificate can not be verified' unless cert2.verify key
|
857
|
+
*
|
858
|
+
* == Certificate Authority
|
859
|
+
*
|
860
|
+
* A certificate authority (CA) is a trusted third party that allows you to
|
861
|
+
* verify the ownership of unknown certificates. The CA issues key signatures
|
862
|
+
* that indicate it trusts the user of that key. A user encountering the key
|
863
|
+
* can verify the signature by using the CA's public key.
|
864
|
+
*
|
865
|
+
* === CA Key
|
866
|
+
*
|
867
|
+
* CA keys are valuable, so we encrypt and save it to disk and make sure it is
|
868
|
+
* not readable by other users.
|
869
|
+
*
|
870
|
+
* ca_key = OpenSSL::PKey::RSA.new 2048
|
871
|
+
* pass_phrase = 'my secure pass phrase goes here'
|
872
|
+
*
|
873
|
+
* cipher = OpenSSL::Cipher.new 'AES-128-CBC'
|
874
|
+
*
|
875
|
+
* open 'ca_key.pem', 'w', 0400 do |io|
|
876
|
+
* io.write ca_key.export(cipher, pass_phrase)
|
877
|
+
* end
|
878
|
+
*
|
879
|
+
* === CA Certificate
|
880
|
+
*
|
881
|
+
* A CA certificate is created the same way we created a certificate above, but
|
882
|
+
* with different extensions.
|
883
|
+
*
|
884
|
+
* ca_name = OpenSSL::X509::Name.parse 'CN=ca/DC=example'
|
885
|
+
*
|
886
|
+
* ca_cert = OpenSSL::X509::Certificate.new
|
887
|
+
* ca_cert.serial = 0
|
888
|
+
* ca_cert.version = 2
|
889
|
+
* ca_cert.not_before = Time.now
|
890
|
+
* ca_cert.not_after = Time.now + 86400
|
891
|
+
*
|
892
|
+
* ca_cert.public_key = ca_key.public_key
|
893
|
+
* ca_cert.subject = ca_name
|
894
|
+
* ca_cert.issuer = ca_name
|
895
|
+
*
|
896
|
+
* extension_factory = OpenSSL::X509::ExtensionFactory.new
|
897
|
+
* extension_factory.subject_certificate = ca_cert
|
898
|
+
* extension_factory.issuer_certificate = ca_cert
|
899
|
+
*
|
900
|
+
* ca_cert.add_extension \
|
901
|
+
* extension_factory.create_extension('subjectKeyIdentifier', 'hash')
|
902
|
+
*
|
903
|
+
* This extension indicates the CA's key may be used as a CA.
|
904
|
+
*
|
905
|
+
* ca_cert.add_extension \
|
906
|
+
* extension_factory.create_extension('basicConstraints', 'CA:TRUE', true)
|
907
|
+
*
|
908
|
+
* This extension indicates the CA's key may be used to verify signatures on
|
909
|
+
* both certificates and certificate revocations.
|
910
|
+
*
|
911
|
+
* ca_cert.add_extension \
|
912
|
+
* extension_factory.create_extension(
|
913
|
+
* 'keyUsage', 'cRLSign,keyCertSign', true)
|
914
|
+
*
|
915
|
+
* Root CA certificates are self-signed.
|
916
|
+
*
|
917
|
+
* ca_cert.sign ca_key, OpenSSL::Digest::SHA1.new
|
918
|
+
*
|
919
|
+
* The CA certificate is saved to disk so it may be distributed to all the
|
920
|
+
* users of the keys this CA will sign.
|
921
|
+
*
|
922
|
+
* open 'ca_cert.pem', 'w' do |io|
|
923
|
+
* io.write ca_cert.to_pem
|
924
|
+
* end
|
925
|
+
*
|
926
|
+
* === Certificate Signing Request
|
927
|
+
*
|
928
|
+
* The CA signs keys through a Certificate Signing Request (CSR). The CSR
|
929
|
+
* contains the information necessary to identify the key.
|
930
|
+
*
|
931
|
+
* csr = OpenSSL::X509::Request.new
|
932
|
+
* csr.version = 0
|
933
|
+
* csr.subject = name
|
934
|
+
* csr.public_key = key.public_key
|
935
|
+
* csr.sign key, OpenSSL::Digest::SHA1.new
|
936
|
+
*
|
937
|
+
* A CSR is saved to disk and sent to the CA for signing.
|
938
|
+
*
|
939
|
+
* open 'csr.pem', 'w' do |io|
|
940
|
+
* io.write csr.to_pem
|
941
|
+
* end
|
942
|
+
*
|
943
|
+
* === Creating a Certificate from a CSR
|
944
|
+
*
|
945
|
+
* Upon receiving a CSR the CA will verify it before signing it. A minimal
|
946
|
+
* verification would be to check the CSR's signature.
|
947
|
+
*
|
948
|
+
* csr = OpenSSL::X509::Request.new File.read 'csr.pem'
|
949
|
+
*
|
950
|
+
* raise 'CSR can not be verified' unless csr.verify csr.public_key
|
951
|
+
*
|
952
|
+
* After verification a certificate is created, marked for various usages,
|
953
|
+
* signed with the CA key and returned to the requester.
|
954
|
+
*
|
955
|
+
* csr_cert = OpenSSL::X509::Certificate.new
|
956
|
+
* csr_cert.serial = 0
|
957
|
+
* csr_cert.version = 2
|
958
|
+
* csr_cert.not_before = Time.now
|
959
|
+
* csr_cert.not_after = Time.now + 600
|
960
|
+
*
|
961
|
+
* csr_cert.subject = csr.subject
|
962
|
+
* csr_cert.public_key = csr.public_key
|
963
|
+
* csr_cert.issuer = ca_cert.subject
|
964
|
+
*
|
965
|
+
* extension_factory = OpenSSL::X509::ExtensionFactory.new
|
966
|
+
* extension_factory.subject_certificate = csr_cert
|
967
|
+
* extension_factory.issuer_certificate = ca_cert
|
968
|
+
*
|
969
|
+
* csr_cert.add_extension \
|
970
|
+
* extension_factory.create_extension('basicConstraints', 'CA:FALSE')
|
971
|
+
*
|
972
|
+
* csr_cert.add_extension \
|
973
|
+
* extension_factory.create_extension(
|
974
|
+
* 'keyUsage', 'keyEncipherment,dataEncipherment,digitalSignature')
|
975
|
+
*
|
976
|
+
* csr_cert.add_extension \
|
977
|
+
* extension_factory.create_extension('subjectKeyIdentifier', 'hash')
|
978
|
+
*
|
979
|
+
* csr_cert.sign ca_key, OpenSSL::Digest::SHA1.new
|
980
|
+
*
|
981
|
+
* open 'csr_cert.pem', 'w' do |io|
|
982
|
+
* io.write csr_cert.to_pem
|
983
|
+
* end
|
984
|
+
*
|
985
|
+
* == SSL and TLS Connections
|
986
|
+
*
|
987
|
+
* Using our created key and certificate we can create an SSL or TLS connection.
|
988
|
+
* An SSLContext is used to set up an SSL session.
|
989
|
+
*
|
990
|
+
* context = OpenSSL::SSL::SSLContext.new
|
991
|
+
*
|
992
|
+
* === SSL Server
|
993
|
+
*
|
994
|
+
* An SSL server requires the certificate and private key to communicate
|
995
|
+
* securely with its clients:
|
996
|
+
*
|
997
|
+
* context.cert = cert
|
998
|
+
* context.key = key
|
999
|
+
*
|
1000
|
+
* Then create an SSLServer with a TCP server socket and the context. Use the
|
1001
|
+
* SSLServer like an ordinary TCP server.
|
1002
|
+
*
|
1003
|
+
* require 'socket'
|
1004
|
+
*
|
1005
|
+
* tcp_server = TCPServer.new 5000
|
1006
|
+
* ssl_server = OpenSSL::SSL::SSLServer.new tcp_server, context
|
1007
|
+
*
|
1008
|
+
* loop do
|
1009
|
+
* ssl_connection = ssl_server.accept
|
1010
|
+
*
|
1011
|
+
* data = connection.gets
|
1012
|
+
*
|
1013
|
+
* response = "I got #{data.dump}"
|
1014
|
+
* puts response
|
1015
|
+
*
|
1016
|
+
* connection.puts "I got #{data.dump}"
|
1017
|
+
* connection.close
|
1018
|
+
* end
|
1019
|
+
*
|
1020
|
+
* === SSL client
|
1021
|
+
*
|
1022
|
+
* An SSL client is created with a TCP socket and the context.
|
1023
|
+
* SSLSocket#connect must be called to initiate the SSL handshake and start
|
1024
|
+
* encryption. A key and certificate are not required for the client socket.
|
1025
|
+
*
|
1026
|
+
* Note that SSLSocket#close doesn't close the underlying socket by default. Set
|
1027
|
+
* SSLSocket#sync_close to true if you want.
|
1028
|
+
*
|
1029
|
+
* require 'socket'
|
1030
|
+
*
|
1031
|
+
* tcp_socket = TCPSocket.new 'localhost', 5000
|
1032
|
+
* ssl_client = OpenSSL::SSL::SSLSocket.new tcp_socket, context
|
1033
|
+
* ssl_client.sync_close = true
|
1034
|
+
* ssl_client.connect
|
1035
|
+
*
|
1036
|
+
* ssl_client.puts "hello server!"
|
1037
|
+
* puts ssl_client.gets
|
1038
|
+
*
|
1039
|
+
* ssl_client.close # shutdown the TLS connection and close tcp_socket
|
1040
|
+
*
|
1041
|
+
* === Peer Verification
|
1042
|
+
*
|
1043
|
+
* An unverified SSL connection does not provide much security. For enhanced
|
1044
|
+
* security the client or server can verify the certificate of its peer.
|
1045
|
+
*
|
1046
|
+
* The client can be modified to verify the server's certificate against the
|
1047
|
+
* certificate authority's certificate:
|
1048
|
+
*
|
1049
|
+
* context.ca_file = 'ca_cert.pem'
|
1050
|
+
* context.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
1051
|
+
*
|
1052
|
+
* require 'socket'
|
1053
|
+
*
|
1054
|
+
* tcp_socket = TCPSocket.new 'localhost', 5000
|
1055
|
+
* ssl_client = OpenSSL::SSL::SSLSocket.new tcp_socket, context
|
1056
|
+
* ssl_client.connect
|
1057
|
+
*
|
1058
|
+
* ssl_client.puts "hello server!"
|
1059
|
+
* puts ssl_client.gets
|
1060
|
+
*
|
1061
|
+
* If the server certificate is invalid or <tt>context.ca_file</tt> is not set
|
1062
|
+
* when verifying peers an OpenSSL::SSL::SSLError will be raised.
|
1063
|
+
*
|
1064
|
+
*/
|
1065
|
+
void
|
1066
|
+
Init_openssl(void)
|
1067
|
+
{
|
1068
|
+
/*
|
1069
|
+
* Init timezone info
|
1070
|
+
*/
|
1071
|
+
#if 0
|
1072
|
+
tzset();
|
1073
|
+
#endif
|
1074
|
+
|
1075
|
+
/*
|
1076
|
+
* Init all digests, ciphers
|
1077
|
+
*/
|
1078
|
+
/* CRYPTO_malloc_init(); */
|
1079
|
+
/* ENGINE_load_builtin_engines(); */
|
1080
|
+
OpenSSL_add_ssl_algorithms();
|
1081
|
+
OpenSSL_add_all_algorithms();
|
1082
|
+
ERR_load_crypto_strings();
|
1083
|
+
SSL_load_error_strings();
|
1084
|
+
|
1085
|
+
/*
|
1086
|
+
* FIXME:
|
1087
|
+
* On unload do:
|
1088
|
+
*/
|
1089
|
+
#if 0
|
1090
|
+
CONF_modules_unload(1);
|
1091
|
+
destroy_ui_method();
|
1092
|
+
EVP_cleanup();
|
1093
|
+
ENGINE_cleanup();
|
1094
|
+
CRYPTO_cleanup_all_ex_data();
|
1095
|
+
ERR_remove_state(0);
|
1096
|
+
ERR_free_strings();
|
1097
|
+
#endif
|
1098
|
+
|
1099
|
+
/*
|
1100
|
+
* Init main module
|
1101
|
+
*/
|
1102
|
+
mOSSL = rb_define_module("OpenSSL");
|
1103
|
+
rb_global_variable(&mOSSL);
|
1104
|
+
|
1105
|
+
/*
|
1106
|
+
* OpenSSL ruby extension version
|
1107
|
+
*/
|
1108
|
+
rb_define_const(mOSSL, "VERSION", rb_str_new2(OSSL_VERSION));
|
1109
|
+
|
1110
|
+
/*
|
1111
|
+
* Version of OpenSSL the ruby OpenSSL extension was built with
|
1112
|
+
*/
|
1113
|
+
rb_define_const(mOSSL, "OPENSSL_VERSION", rb_str_new2(OPENSSL_VERSION_TEXT));
|
1114
|
+
|
1115
|
+
/*
|
1116
|
+
* Version of OpenSSL the ruby OpenSSL extension is running with
|
1117
|
+
*/
|
1118
|
+
rb_define_const(mOSSL, "OPENSSL_LIBRARY_VERSION", rb_str_new2(SSLeay_version(SSLEAY_VERSION)));
|
1119
|
+
|
1120
|
+
/*
|
1121
|
+
* Version number of OpenSSL the ruby OpenSSL extension was built with
|
1122
|
+
* (base 16)
|
1123
|
+
*/
|
1124
|
+
rb_define_const(mOSSL, "OPENSSL_VERSION_NUMBER", INT2NUM(OPENSSL_VERSION_NUMBER));
|
1125
|
+
|
1126
|
+
/*
|
1127
|
+
* Boolean indicating whether OpenSSL is FIPS-enabled or not
|
1128
|
+
*/
|
1129
|
+
rb_define_const(mOSSL, "OPENSSL_FIPS",
|
1130
|
+
#ifdef OPENSSL_FIPS
|
1131
|
+
Qtrue
|
1132
|
+
#else
|
1133
|
+
Qfalse
|
1134
|
+
#endif
|
1135
|
+
);
|
1136
|
+
|
1137
|
+
rb_define_module_function(mOSSL, "fips_mode=", ossl_fips_mode_set, 1);
|
1138
|
+
|
1139
|
+
/*
|
1140
|
+
* Generic error,
|
1141
|
+
* common for all classes under OpenSSL module
|
1142
|
+
*/
|
1143
|
+
eOSSLError = rb_define_class_under(mOSSL,"OpenSSLError",rb_eStandardError);
|
1144
|
+
rb_global_variable(&eOSSLError);
|
1145
|
+
|
1146
|
+
/*
|
1147
|
+
* Init debug core
|
1148
|
+
*/
|
1149
|
+
dOSSL = Qfalse;
|
1150
|
+
rb_global_variable(&dOSSL);
|
1151
|
+
|
1152
|
+
rb_define_module_function(mOSSL, "debug", ossl_debug_get, 0);
|
1153
|
+
rb_define_module_function(mOSSL, "debug=", ossl_debug_set, 1);
|
1154
|
+
rb_define_module_function(mOSSL, "errors", ossl_get_errors, 0);
|
1155
|
+
|
1156
|
+
/*
|
1157
|
+
* Verify callback Proc index for ext-data
|
1158
|
+
*/
|
1159
|
+
if ((ossl_store_ctx_ex_verify_cb_idx = X509_STORE_CTX_get_ex_new_index(0, (void *)"ossl_store_ctx_ex_verify_cb_idx", 0, 0, 0)) < 0)
|
1160
|
+
ossl_raise(eOSSLError, "X509_STORE_CTX_get_ex_new_index");
|
1161
|
+
if ((ossl_store_ex_verify_cb_idx = X509_STORE_get_ex_new_index(0, (void *)"ossl_store_ex_verify_cb_idx", 0, 0, 0)) < 0)
|
1162
|
+
ossl_raise(eOSSLError, "X509_STORE_get_ex_new_index");
|
1163
|
+
|
1164
|
+
/*
|
1165
|
+
* Get ID of to_der
|
1166
|
+
*/
|
1167
|
+
ossl_s_to_der = rb_intern("to_der");
|
1168
|
+
|
1169
|
+
#if !defined(HAVE_OPENSSL_110_THREADING_API)
|
1170
|
+
Init_ossl_locks();
|
1171
|
+
#endif
|
1172
|
+
|
1173
|
+
/*
|
1174
|
+
* Init components
|
1175
|
+
*/
|
1176
|
+
Init_ossl_bn();
|
1177
|
+
Init_ossl_cipher();
|
1178
|
+
Init_ossl_config();
|
1179
|
+
Init_ossl_digest();
|
1180
|
+
Init_ossl_hmac();
|
1181
|
+
Init_ossl_ns_spki();
|
1182
|
+
Init_ossl_pkcs12();
|
1183
|
+
Init_ossl_pkcs7();
|
1184
|
+
Init_ossl_pkcs5();
|
1185
|
+
Init_ossl_pkey();
|
1186
|
+
Init_ossl_rand();
|
1187
|
+
Init_ossl_ssl();
|
1188
|
+
Init_ossl_x509();
|
1189
|
+
Init_ossl_ocsp();
|
1190
|
+
Init_ossl_engine();
|
1191
|
+
Init_ossl_asn1();
|
1192
|
+
}
|
1193
|
+
|
1194
|
+
#if defined(OSSL_DEBUG)
|
1195
|
+
/*
|
1196
|
+
* Check if all symbols are OK with 'make LDSHARED=gcc all'
|
1197
|
+
*/
|
1198
|
+
int
|
1199
|
+
main(int argc, char *argv[])
|
1200
|
+
{
|
1201
|
+
return 0;
|
1202
|
+
}
|
1203
|
+
#endif /* OSSL_DEBUG */
|