rho-tau-extensions 5.5.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (661) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +2 -0
  3. data/LICENSE +21 -0
  4. data/README.md +6 -0
  5. data/Rakefile +90 -0
  6. data/libs/crosswalk.rb +2 -0
  7. data/libs/crosswalk/crosswalk.rb +2 -0
  8. data/libs/crosswalk/ext.yml +21 -0
  9. data/libs/crosswalk/ext/Crosswalk.xml +27 -0
  10. data/libs/crosswalk/ext/build +19 -0
  11. data/libs/crosswalk/ext/build.bat +29 -0
  12. data/libs/crosswalk/ext/platform/android/AndroidManifest.xml +9 -0
  13. data/libs/crosswalk/ext/platform/android/Rakefile +141 -0
  14. data/libs/crosswalk/ext/platform/android/adds/lib/armeabi/libxwalkcore.so +0 -0
  15. data/libs/crosswalk/ext/platform/android/adds/lib/armeabi/libxwalkdummy.so +0 -0
  16. data/libs/crosswalk/ext/platform/android/adds/lib/x86/libxwalkcore.so +0 -0
  17. data/libs/crosswalk/ext/platform/android/adds/lib/x86/libxwalkdummy.so +0 -0
  18. data/libs/crosswalk/ext/platform/android/adds/lib/xwalk_core_library_java.jar +0 -0
  19. data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/bubble.9.png +0 -0
  20. data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/bubble_arrow_up.png +0 -0
  21. data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/color_picker_advanced_select_handle.png +0 -0
  22. data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/crosswalk.png +0 -0
  23. data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/dropdown_popup_background_down.9.png +0 -0
  24. data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/dropdown_popup_background_up.9.png +0 -0
  25. data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/ic_menu_share_holo_light.png +0 -0
  26. data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/ic_search.png +0 -0
  27. data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/ic_warning.png +0 -0
  28. data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/ondemand_overlay.9.png +0 -0
  29. data/libs/crosswalk/ext/platform/android/adds/res/drawable-hdpi/verify_checkmark.png +0 -0
  30. data/libs/crosswalk/ext/platform/android/adds/res/drawable-ldpi/crosswalk.png +0 -0
  31. data/libs/crosswalk/ext/platform/android/adds/res/drawable-mdpi/crosswalk.png +0 -0
  32. data/libs/crosswalk/ext/platform/android/adds/res/drawable-v21/button_borderless_compat.xml +10 -0
  33. data/libs/crosswalk/ext/platform/android/adds/res/drawable-v21/button_compat.xml +9 -0
  34. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/bubble.9.png +0 -0
  35. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/bubble_arrow_up.png +0 -0
  36. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/color_picker_advanced_select_handle.png +0 -0
  37. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/crosswalk.png +0 -0
  38. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/dropdown_popup_background_down.9.png +0 -0
  39. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/dropdown_popup_background_up.9.png +0 -0
  40. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/ic_menu_share_holo_light.png +0 -0
  41. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/ic_search.png +0 -0
  42. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/ic_warning.png +0 -0
  43. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/ondemand_overlay.9.png +0 -0
  44. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xhdpi/verify_checkmark.png +0 -0
  45. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxhdpi/ic_menu_share_holo_light.png +0 -0
  46. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxhdpi/ic_search.png +0 -0
  47. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxhdpi/ic_warning.png +0 -0
  48. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxhdpi/verify_checkmark.png +0 -0
  49. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxxhdpi/ic_menu_share_holo_light.png +0 -0
  50. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxxhdpi/ic_search.png +0 -0
  51. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxxhdpi/ic_warning.png +0 -0
  52. data/libs/crosswalk/ext/platform/android/adds/res/drawable-xxxhdpi/verify_checkmark.png +0 -0
  53. data/libs/crosswalk/ext/platform/android/adds/res/drawable/autofill_chip_inset.xml +15 -0
  54. data/libs/crosswalk/ext/platform/android/adds/res/drawable/bubble.9.png +0 -0
  55. data/libs/crosswalk/ext/platform/android/adds/res/drawable/bubble_arrow_up.png +0 -0
  56. data/libs/crosswalk/ext/platform/android/adds/res/drawable/button_compat_shape.xml +9 -0
  57. data/libs/crosswalk/ext/platform/android/adds/res/drawable/color_button_background.xml +36 -0
  58. data/libs/crosswalk/ext/platform/android/adds/res/drawable/color_picker_advanced_select_handle.png +0 -0
  59. data/libs/crosswalk/ext/platform/android/adds/res/drawable/color_picker_border.xml +12 -0
  60. data/libs/crosswalk/ext/platform/android/adds/res/drawable/dropdown_label_color.xml +11 -0
  61. data/libs/crosswalk/ext/platform/android/adds/res/drawable/dropdown_popup_background.xml +13 -0
  62. data/libs/crosswalk/ext/platform/android/adds/res/drawable/dropdown_popup_background_down.9.png +0 -0
  63. data/libs/crosswalk/ext/platform/android/adds/res/drawable/dropdown_popup_background_up.9.png +0 -0
  64. data/libs/crosswalk/ext/platform/android/adds/res/drawable/ic_menu_share_holo_light.png +0 -0
  65. data/libs/crosswalk/ext/platform/android/adds/res/drawable/ic_search.png +0 -0
  66. data/libs/crosswalk/ext/platform/android/adds/res/drawable/ic_warning.png +0 -0
  67. data/libs/crosswalk/ext/platform/android/adds/res/drawable/launchscreen_bg.xml +19 -0
  68. data/libs/crosswalk/ext/platform/android/adds/res/drawable/ondemand_overlay.9.png +0 -0
  69. data/libs/crosswalk/ext/platform/android/adds/res/drawable/verify_checkmark.png +0 -0
  70. data/libs/crosswalk/ext/platform/android/adds/res/layout-land/date_time_picker_dialog.xml +42 -0
  71. data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/autofill_keyboard_accessory_item.xml +40 -0
  72. data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/autofill_suggestion_item.xml +18 -0
  73. data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/color_picker_advanced_component.xml +46 -0
  74. data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/color_picker_dialog_content.xml +51 -0
  75. data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/color_picker_dialog_title.xml +41 -0
  76. data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/date_time_suggestion.xml +35 -0
  77. data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/dropdown_item.xml +58 -0
  78. data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/multi_field_time_picker_dialog.xml +122 -0
  79. data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/two_field_date_picker.xml +38 -0
  80. data/libs/crosswalk/ext/platform/android/adds/res/layout-v17/validation_message_bubble.xml +72 -0
  81. data/libs/crosswalk/ext/platform/android/adds/res/layout/autofill_keyboard_accessory_icon.xml +13 -0
  82. data/libs/crosswalk/ext/platform/android/adds/res/layout/autofill_keyboard_accessory_item.xml +17 -0
  83. data/libs/crosswalk/ext/platform/android/adds/res/layout/autofill_suggestion_item.xml +7 -0
  84. data/libs/crosswalk/ext/platform/android/adds/res/layout/color_picker_advanced_component.xml +30 -0
  85. data/libs/crosswalk/ext/platform/android/adds/res/layout/color_picker_dialog_content.xml +36 -0
  86. data/libs/crosswalk/ext/platform/android/adds/res/layout/color_picker_dialog_title.xml +25 -0
  87. data/libs/crosswalk/ext/platform/android/adds/res/layout/date_time_picker_dialog.xml +42 -0
  88. data/libs/crosswalk/ext/platform/android/adds/res/layout/date_time_suggestion.xml +16 -0
  89. data/libs/crosswalk/ext/platform/android/adds/res/layout/dropdown_item.xml +34 -0
  90. data/libs/crosswalk/ext/platform/android/adds/res/layout/multi_field_time_picker_dialog.xml +50 -0
  91. data/libs/crosswalk/ext/platform/android/adds/res/layout/two_field_date_picker.xml +26 -0
  92. data/libs/crosswalk/ext/platform/android/adds/res/layout/validation_message_bubble.xml +47 -0
  93. data/libs/crosswalk/ext/platform/android/adds/res/menu/select_action_menu.xml +54 -0
  94. data/libs/crosswalk/ext/platform/android/adds/res/raw/contacts_api.js +206 -0
  95. data/libs/crosswalk/ext/platform/android/adds/res/raw/device_capabilities_api.js +231 -0
  96. data/libs/crosswalk/ext/platform/android/adds/res/raw/empty.wav +0 -0
  97. data/libs/crosswalk/ext/platform/android/adds/res/raw/icudtl.dat +0 -0
  98. data/libs/crosswalk/ext/platform/android/adds/res/raw/launch_screen_api.js +9 -0
  99. data/libs/crosswalk/ext/platform/android/adds/res/raw/messaging_api.js +359 -0
  100. data/libs/crosswalk/ext/platform/android/adds/res/raw/presentation_api.js +144 -0
  101. data/libs/crosswalk/ext/platform/android/adds/res/raw/wifidirect_api.js +227 -0
  102. data/libs/crosswalk/ext/platform/android/adds/res/raw/xwalk.pak +0 -0
  103. data/libs/crosswalk/ext/platform/android/adds/res/values-am/android_content_strings.xml +15 -0
  104. data/libs/crosswalk/ext/platform/android/adds/res/values-am/android_ui_strings.xml +47 -0
  105. data/libs/crosswalk/ext/platform/android/adds/res/values-ar/android_content_strings.xml +15 -0
  106. data/libs/crosswalk/ext/platform/android/adds/res/values-ar/android_ui_strings.xml +47 -0
  107. data/libs/crosswalk/ext/platform/android/adds/res/values-bg/android_content_strings.xml +15 -0
  108. data/libs/crosswalk/ext/platform/android/adds/res/values-bg/android_ui_strings.xml +47 -0
  109. data/libs/crosswalk/ext/platform/android/adds/res/values-ca/android_content_strings.xml +15 -0
  110. data/libs/crosswalk/ext/platform/android/adds/res/values-ca/android_ui_strings.xml +47 -0
  111. data/libs/crosswalk/ext/platform/android/adds/res/values-cs/android_content_strings.xml +15 -0
  112. data/libs/crosswalk/ext/platform/android/adds/res/values-cs/android_ui_strings.xml +47 -0
  113. data/libs/crosswalk/ext/platform/android/adds/res/values-da/android_content_strings.xml +15 -0
  114. data/libs/crosswalk/ext/platform/android/adds/res/values-da/android_ui_strings.xml +47 -0
  115. data/libs/crosswalk/ext/platform/android/adds/res/values-de/android_content_strings.xml +15 -0
  116. data/libs/crosswalk/ext/platform/android/adds/res/values-de/android_ui_strings.xml +47 -0
  117. data/libs/crosswalk/ext/platform/android/adds/res/values-el/android_content_strings.xml +15 -0
  118. data/libs/crosswalk/ext/platform/android/adds/res/values-el/android_ui_strings.xml +47 -0
  119. data/libs/crosswalk/ext/platform/android/adds/res/values-en-rGB/android_content_strings.xml +15 -0
  120. data/libs/crosswalk/ext/platform/android/adds/res/values-en-rGB/android_ui_strings.xml +47 -0
  121. data/libs/crosswalk/ext/platform/android/adds/res/values-es-rUS/android_content_strings.xml +15 -0
  122. data/libs/crosswalk/ext/platform/android/adds/res/values-es-rUS/android_ui_strings.xml +47 -0
  123. data/libs/crosswalk/ext/platform/android/adds/res/values-es/android_content_strings.xml +15 -0
  124. data/libs/crosswalk/ext/platform/android/adds/res/values-es/android_ui_strings.xml +47 -0
  125. data/libs/crosswalk/ext/platform/android/adds/res/values-fa/android_content_strings.xml +15 -0
  126. data/libs/crosswalk/ext/platform/android/adds/res/values-fa/android_ui_strings.xml +47 -0
  127. data/libs/crosswalk/ext/platform/android/adds/res/values-fi/android_content_strings.xml +15 -0
  128. data/libs/crosswalk/ext/platform/android/adds/res/values-fi/android_ui_strings.xml +47 -0
  129. data/libs/crosswalk/ext/platform/android/adds/res/values-fr/android_content_strings.xml +15 -0
  130. data/libs/crosswalk/ext/platform/android/adds/res/values-fr/android_ui_strings.xml +47 -0
  131. data/libs/crosswalk/ext/platform/android/adds/res/values-hi/android_content_strings.xml +15 -0
  132. data/libs/crosswalk/ext/platform/android/adds/res/values-hi/android_ui_strings.xml +47 -0
  133. data/libs/crosswalk/ext/platform/android/adds/res/values-hr/android_content_strings.xml +15 -0
  134. data/libs/crosswalk/ext/platform/android/adds/res/values-hr/android_ui_strings.xml +47 -0
  135. data/libs/crosswalk/ext/platform/android/adds/res/values-hu/android_content_strings.xml +15 -0
  136. data/libs/crosswalk/ext/platform/android/adds/res/values-hu/android_ui_strings.xml +47 -0
  137. data/libs/crosswalk/ext/platform/android/adds/res/values-in/android_content_strings.xml +15 -0
  138. data/libs/crosswalk/ext/platform/android/adds/res/values-in/android_ui_strings.xml +47 -0
  139. data/libs/crosswalk/ext/platform/android/adds/res/values-it/android_content_strings.xml +15 -0
  140. data/libs/crosswalk/ext/platform/android/adds/res/values-it/android_ui_strings.xml +47 -0
  141. data/libs/crosswalk/ext/platform/android/adds/res/values-iw/android_content_strings.xml +15 -0
  142. data/libs/crosswalk/ext/platform/android/adds/res/values-iw/android_ui_strings.xml +47 -0
  143. data/libs/crosswalk/ext/platform/android/adds/res/values-ja/android_content_strings.xml +15 -0
  144. data/libs/crosswalk/ext/platform/android/adds/res/values-ja/android_ui_strings.xml +47 -0
  145. data/libs/crosswalk/ext/platform/android/adds/res/values-ko/android_content_strings.xml +15 -0
  146. data/libs/crosswalk/ext/platform/android/adds/res/values-ko/android_ui_strings.xml +47 -0
  147. data/libs/crosswalk/ext/platform/android/adds/res/values-lt/android_content_strings.xml +15 -0
  148. data/libs/crosswalk/ext/platform/android/adds/res/values-lt/android_ui_strings.xml +47 -0
  149. data/libs/crosswalk/ext/platform/android/adds/res/values-lv/android_content_strings.xml +15 -0
  150. data/libs/crosswalk/ext/platform/android/adds/res/values-lv/android_ui_strings.xml +47 -0
  151. data/libs/crosswalk/ext/platform/android/adds/res/values-nb/android_content_strings.xml +15 -0
  152. data/libs/crosswalk/ext/platform/android/adds/res/values-nb/android_ui_strings.xml +47 -0
  153. data/libs/crosswalk/ext/platform/android/adds/res/values-nl/android_content_strings.xml +15 -0
  154. data/libs/crosswalk/ext/platform/android/adds/res/values-nl/android_ui_strings.xml +47 -0
  155. data/libs/crosswalk/ext/platform/android/adds/res/values-pl/android_content_strings.xml +15 -0
  156. data/libs/crosswalk/ext/platform/android/adds/res/values-pl/android_ui_strings.xml +47 -0
  157. data/libs/crosswalk/ext/platform/android/adds/res/values-pt-rBR/android_content_strings.xml +15 -0
  158. data/libs/crosswalk/ext/platform/android/adds/res/values-pt-rBR/android_ui_strings.xml +47 -0
  159. data/libs/crosswalk/ext/platform/android/adds/res/values-pt-rPT/android_content_strings.xml +15 -0
  160. data/libs/crosswalk/ext/platform/android/adds/res/values-pt-rPT/android_ui_strings.xml +47 -0
  161. data/libs/crosswalk/ext/platform/android/adds/res/values-ro/android_content_strings.xml +15 -0
  162. data/libs/crosswalk/ext/platform/android/adds/res/values-ro/android_ui_strings.xml +47 -0
  163. data/libs/crosswalk/ext/platform/android/adds/res/values-ru/android_content_strings.xml +15 -0
  164. data/libs/crosswalk/ext/platform/android/adds/res/values-ru/android_ui_strings.xml +47 -0
  165. data/libs/crosswalk/ext/platform/android/adds/res/values-sk/android_content_strings.xml +15 -0
  166. data/libs/crosswalk/ext/platform/android/adds/res/values-sk/android_ui_strings.xml +47 -0
  167. data/libs/crosswalk/ext/platform/android/adds/res/values-sl/android_content_strings.xml +15 -0
  168. data/libs/crosswalk/ext/platform/android/adds/res/values-sl/android_ui_strings.xml +47 -0
  169. data/libs/crosswalk/ext/platform/android/adds/res/values-sr/android_content_strings.xml +15 -0
  170. data/libs/crosswalk/ext/platform/android/adds/res/values-sr/android_ui_strings.xml +47 -0
  171. data/libs/crosswalk/ext/platform/android/adds/res/values-sv/android_content_strings.xml +15 -0
  172. data/libs/crosswalk/ext/platform/android/adds/res/values-sv/android_ui_strings.xml +47 -0
  173. data/libs/crosswalk/ext/platform/android/adds/res/values-sw/android_content_strings.xml +15 -0
  174. data/libs/crosswalk/ext/platform/android/adds/res/values-sw/android_ui_strings.xml +47 -0
  175. data/libs/crosswalk/ext/platform/android/adds/res/values-th/android_content_strings.xml +15 -0
  176. data/libs/crosswalk/ext/platform/android/adds/res/values-th/android_ui_strings.xml +47 -0
  177. data/libs/crosswalk/ext/platform/android/adds/res/values-tl/android_content_strings.xml +15 -0
  178. data/libs/crosswalk/ext/platform/android/adds/res/values-tl/android_ui_strings.xml +47 -0
  179. data/libs/crosswalk/ext/platform/android/adds/res/values-tr/android_content_strings.xml +15 -0
  180. data/libs/crosswalk/ext/platform/android/adds/res/values-tr/android_ui_strings.xml +47 -0
  181. data/libs/crosswalk/ext/platform/android/adds/res/values-uk/android_content_strings.xml +15 -0
  182. data/libs/crosswalk/ext/platform/android/adds/res/values-uk/android_ui_strings.xml +47 -0
  183. data/libs/crosswalk/ext/platform/android/adds/res/values-v14/theme.xml +16 -0
  184. data/libs/crosswalk/ext/platform/android/adds/res/values-v17/styles.xml +19 -0
  185. data/libs/crosswalk/ext/platform/android/adds/res/values-v17/ui_java_styles.xml +41 -0
  186. data/libs/crosswalk/ext/platform/android/adds/res/values-v21/styles.xml +14 -0
  187. data/libs/crosswalk/ext/platform/android/adds/res/values-v21/ui_java_styles.xml +14 -0
  188. data/libs/crosswalk/ext/platform/android/adds/res/values-vi/android_content_strings.xml +15 -0
  189. data/libs/crosswalk/ext/platform/android/adds/res/values-vi/android_ui_strings.xml +47 -0
  190. data/libs/crosswalk/ext/platform/android/adds/res/values-zh-rCN/android_content_strings.xml +15 -0
  191. data/libs/crosswalk/ext/platform/android/adds/res/values-zh-rCN/android_ui_strings.xml +47 -0
  192. data/libs/crosswalk/ext/platform/android/adds/res/values-zh-rTW/android_content_strings.xml +15 -0
  193. data/libs/crosswalk/ext/platform/android/adds/res/values-zh-rTW/android_ui_strings.xml +47 -0
  194. data/libs/crosswalk/ext/platform/android/adds/res/values/android_content_strings.xml +15 -0
  195. data/libs/crosswalk/ext/platform/android/adds/res/values/android_ui_strings.xml +47 -0
  196. data/libs/crosswalk/ext/platform/android/adds/res/values/android_xwalk_strings.xml +17 -0
  197. data/libs/crosswalk/ext/platform/android/adds/res/values/ui_java_attrs.xml +9 -0
  198. data/libs/crosswalk/ext/platform/android/adds/res/values/ui_java_dimens.xml +31 -0
  199. data/libs/crosswalk/ext/platform/android/adds/res/values/ui_java_strings.xml +16 -0
  200. data/libs/crosswalk/ext/platform/android/adds/res/values/ui_java_styles.xml +101 -0
  201. data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_app_strings.xml +28 -0
  202. data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_attrs.xml +11 -0
  203. data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_colors.xml +13 -0
  204. data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_core_internal_java_strings.xml +16 -0
  205. data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_core_java_strings.xml +16 -0
  206. data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_dimens.xml +11 -0
  207. data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_resources_list.xml +7 -0
  208. data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_styles.xml +40 -0
  209. data/libs/crosswalk/ext/platform/android/adds/res/values/xwalk_values.xml +10 -0
  210. data/libs/crosswalk/ext/platform/android/ext_java.files +14 -0
  211. data/libs/crosswalk/ext/platform/android/ext_native.files +7 -0
  212. data/libs/crosswalk/ext/platform/android/jni/Crosswalk_impl.cpp +61 -0
  213. data/libs/crosswalk/ext/platform/android/src/com/rho/crosswalk/Crosswalk.java +14 -0
  214. data/libs/crosswalk/ext/platform/android/src/com/rho/crosswalk/CrosswalkFactory.java +18 -0
  215. data/libs/crosswalk/ext/platform/android/src/com/rho/crosswalk/CrosswalkSingleton.java +24 -0
  216. data/libs/crosswalk/ext/platform/android/src/com/tautechnologies/tau/crosswalk/CrosswalkExtension.java +16 -0
  217. data/libs/crosswalk/ext/platform/android/src/com/tautechnologies/tau/crosswalk/RhodesListener.java +18 -0
  218. data/libs/crosswalk/ext/platform/android/src/com/tautechnologies/tau/crosswalk/TauXWResourceClient.java +182 -0
  219. data/libs/crosswalk/ext/platform/android/src/com/tautechnologies/tau/crosswalk/TauXWUIClient.java +125 -0
  220. data/libs/crosswalk/ext/platform/android/src/com/tautechnologies/tau/crosswalk/TauXWalkWebView.java +368 -0
  221. data/libs/crosswalk/ext/platform/iphone/Crosswalk.xcodeproj/project.pbxproj +368 -0
  222. data/libs/crosswalk/ext/platform/iphone/Crosswalk_Prefix.pch +7 -0
  223. data/libs/crosswalk/ext/platform/iphone/Rakefile +73 -0
  224. data/libs/crosswalk/ext/platform/iphone/impl/Crosswalk.h +14 -0
  225. data/libs/crosswalk/ext/platform/iphone/impl/Crosswalk.m +24 -0
  226. data/libs/crosswalk/ext/platform/iphone/impl/CrosswalkFactorySingleton.m +16 -0
  227. data/libs/crosswalk/ext/platform/iphone/impl/CrosswalkSetup.m +9 -0
  228. data/libs/crosswalk/ext/platform/iphone/impl/CrosswalkSingleton.h +17 -0
  229. data/libs/crosswalk/ext/platform/iphone/impl/CrosswalkSingleton.m +23 -0
  230. data/libs/crosswalk/ext/platform/iphone/impl/readme.txt +7 -0
  231. data/libs/crosswalk/ext/platform/qt/Crosswalk.pro +66 -0
  232. data/libs/crosswalk/ext/platform/qt/Rakefile +35 -0
  233. data/libs/crosswalk/ext/platform/qt/src/Crosswalk_impl.cpp +77 -0
  234. data/libs/crosswalk/ext/platform/wm/Crosswalk.sln +52 -0
  235. data/libs/crosswalk/ext/platform/wm/Crosswalk.vcproj +714 -0
  236. data/libs/crosswalk/ext/platform/wm/Crosswalk.vsprops +15 -0
  237. data/libs/crosswalk/ext/platform/wm/src/Crosswalk_impl.cpp +77 -0
  238. data/libs/crosswalk/ext/platform/wp8/Crosswalk.props +18 -0
  239. data/libs/crosswalk/ext/platform/wp8/Crosswalk.vcxproj +170 -0
  240. data/libs/crosswalk/ext/platform/wp8/Crosswalk.vcxproj.filters +50 -0
  241. data/libs/crosswalk/ext/platform/wp8/CrosswalkImpl.csproj +119 -0
  242. data/libs/crosswalk/ext/platform/wp8/CrosswalkImpl.props +8 -0
  243. data/libs/crosswalk/ext/platform/wp8/CrosswalkImpl.targets +7 -0
  244. data/libs/crosswalk/ext/platform/wp8/CrosswalkLib.props +18 -0
  245. data/libs/crosswalk/ext/platform/wp8/CrosswalkLib.vcxproj +185 -0
  246. data/libs/crosswalk/ext/platform/wp8/CrosswalkLib.vcxproj.filters +58 -0
  247. data/libs/crosswalk/ext/platform/wp8/src/Crosswalk_impl.cpp +76 -0
  248. data/libs/crosswalk/ext/platform/wp8/src/Crosswalk_impl.cs +69 -0
  249. data/libs/crosswalk/ext/platform/wp8/src/Properties/AssemblyInfo.cs +37 -0
  250. data/libs/enterprise-barcode/ext.yml +13 -0
  251. data/libs/enterprise-barcode/ext/barcode.xml +2144 -0
  252. data/libs/enterprise-barcode/ext/build +17 -0
  253. data/libs/enterprise-barcode/ext/build.bat +29 -0
  254. data/libs/enterprise-barcode/ext/platform/android/AndroidManifest.xml +31 -0
  255. data/libs/enterprise-barcode/ext/platform/android/ZXing_Info/AUTHORS +58 -0
  256. data/libs/enterprise-barcode/ext/platform/android/ZXing_Info/CHANGES +266 -0
  257. data/libs/enterprise-barcode/ext/platform/android/ZXing_Info/COPYING +201 -0
  258. data/libs/enterprise-barcode/ext/platform/android/ZXing_Info/README +11 -0
  259. data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable-hdpi/cancel_icon.png +0 -0
  260. data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable-hdpi/ok_icon.png +0 -0
  261. data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable-hdpi/retake_icon.png +0 -0
  262. data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable/cancel_icon.png +0 -0
  263. data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable/ok_icon.png +0 -0
  264. data/libs/enterprise-barcode/ext/platform/android/additional_files/res/drawable/retake_icon.png +0 -0
  265. data/libs/enterprise-barcode/ext/platform/android/additional_files/res/layout/capture.xml +122 -0
  266. data/libs/enterprise-barcode/ext/platform/android/additional_files/res/raw/beep.ogg +0 -0
  267. data/libs/enterprise-barcode/ext/platform/android/additional_files/res/values/attrs.xml +20 -0
  268. data/libs/enterprise-barcode/ext/platform/android/additional_files/res/values/colors.xml +42 -0
  269. data/libs/enterprise-barcode/ext/platform/android/additional_files/res/values/ids.xml +31 -0
  270. data/libs/enterprise-barcode/ext/platform/android/adds/lib/armeabi/liballbarcode.a +0 -0
  271. data/libs/enterprise-barcode/ext/platform/android/adds/lib/x86/liballbarcode.a +0 -0
  272. data/libs/enterprise-barcode/ext/platform/android/allbarcode.jar +0 -0
  273. data/libs/enterprise-barcode/ext/platform/iphone/Barcode.xcodeproj/project.pbxproj +524 -0
  274. data/libs/enterprise-barcode/ext/platform/iphone/Barcode_Prefix.pch +7 -0
  275. data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeCallbackHelper.h +27 -0
  276. data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeCallbackHelper.mm +231 -0
  277. data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewController.h +95 -0
  278. data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewController.m +1017 -0
  279. data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewFactory.h +7 -0
  280. data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewFactory.mm +58 -0
  281. data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewFactoryRegister.mm +18 -0
  282. data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewManager.h +16 -0
  283. data/libs/enterprise-barcode/ext/platform/iphone/Classes/BarcodeViewManager.mm +32 -0
  284. data/libs/enterprise-barcode/ext/platform/iphone/Classes/ImageProvider.cpp +25 -0
  285. data/libs/enterprise-barcode/ext/platform/iphone/Classes/ImageProvider.h +15 -0
  286. data/libs/enterprise-barcode/ext/platform/iphone/Classes/ImageProvider.mm +159 -0
  287. data/libs/enterprise-barcode/ext/platform/iphone/Classes/barcode.m +123 -0
  288. data/libs/enterprise-barcode/ext/platform/iphone/Rakefile +69 -0
  289. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/COPYING +27 -0
  290. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarCameraSimulator.h +45 -0
  291. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarCaptureReader.h +111 -0
  292. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarHelpController.h +60 -0
  293. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarImage.h +69 -0
  294. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarImageScanner.h +51 -0
  295. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarReaderController.h +142 -0
  296. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarReaderView.h +135 -0
  297. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarReaderViewController.h +130 -0
  298. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarSDK.h +34 -0
  299. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/ZBarSymbol.h +71 -0
  300. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar.h +1497 -0
  301. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Decoder.h +202 -0
  302. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Exception.h +187 -0
  303. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Image.h +321 -0
  304. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/ImageScanner.h +130 -0
  305. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Processor.h +223 -0
  306. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Scanner.h +162 -0
  307. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Symbol.h +528 -0
  308. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Video.h +170 -0
  309. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Headers/ZBarSDK/zbar/Window.h +136 -0
  310. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/LICENSE +504 -0
  311. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/README +59 -0
  312. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Resources/zbar-back.png +0 -0
  313. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Resources/zbar-help.html +88 -0
  314. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Resources/zbar-helpicons.png +0 -0
  315. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/Resources/zbar-samples.png +0 -0
  316. data/libs/enterprise-barcode/ext/platform/iphone/ZBarSDK/libzbar.a +0 -0
  317. data/libs/enterprise-barcode/ext/platform/iphone/impl/Barcode.h +21 -0
  318. data/libs/enterprise-barcode/ext/platform/iphone/impl/Barcode.m +132 -0
  319. data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeFactory.h +10 -0
  320. data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeFactory.m +16 -0
  321. data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeFactorySingleton.m +16 -0
  322. data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeSetup.m +8 -0
  323. data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeSingleton.h +17 -0
  324. data/libs/enterprise-barcode/ext/platform/iphone/impl/BarcodeSingleton.m +22 -0
  325. data/libs/enterprise-barcode/ext/platform/iphone/impl/readme.txt +7 -0
  326. data/libs/enterprise-barcode/ext/platform/wm/Barcode.sln +44 -0
  327. data/libs/enterprise-barcode/ext/platform/wm/Barcode.vcproj +836 -0
  328. data/libs/enterprise-barcode/ext/platform/wm/Barcode.vsprops +15 -0
  329. data/libs/enterprise-barcode/ext/platform/wm/readme.txt +0 -0
  330. data/libs/enterprise-barcode/ext/platform/wm/src/Barcode_impl.cpp +376 -0
  331. data/libs/enterprise-barcode/ext/platform/wm/src/DecodeNotifier.cpp +173 -0
  332. data/libs/enterprise-barcode/ext/platform/wm/src/DecodeNotifier.h +149 -0
  333. data/libs/enterprise-barcode/ext/platform/wm/src/EMDKInterfaceAbstraction.cpp +476 -0
  334. data/libs/enterprise-barcode/ext/platform/wm/src/GetDecoderProperties.cpp +1195 -0
  335. data/libs/enterprise-barcode/ext/platform/wm/src/GetScannerProperties.cpp +553 -0
  336. data/libs/enterprise-barcode/ext/platform/wm/src/KeyInjector.cpp +177 -0
  337. data/libs/enterprise-barcode/ext/platform/wm/src/KeyInjector.h +40 -0
  338. data/libs/enterprise-barcode/ext/platform/wm/src/NotificationLoader.cpp +76 -0
  339. data/libs/enterprise-barcode/ext/platform/wm/src/NotificationLoader.h +44 -0
  340. data/libs/enterprise-barcode/ext/platform/wm/src/RSM.cpp +1211 -0
  341. data/libs/enterprise-barcode/ext/platform/wm/src/Scanner.cpp +2609 -0
  342. data/libs/enterprise-barcode/ext/platform/wm/src/Scanner.h +1099 -0
  343. data/libs/enterprise-barcode/ext/platform/wm/src/ScannerDefines.h +322 -0
  344. data/libs/enterprise-barcode/ext/platform/wm/src/SetDecoderProperties.cpp +2106 -0
  345. data/libs/enterprise-barcode/ext/platform/wm/src/SetScannerProperties.cpp +1060 -0
  346. data/libs/enterprise-barcode/ext/platform/wm/src/Utilities.cpp +184 -0
  347. data/libs/enterprise-barcode/ext/platform/wp8/BarcodeImpl.csproj +119 -0
  348. data/libs/enterprise-barcode/ext/platform/wp8/BarcodeImpl.props +8 -0
  349. data/libs/enterprise-barcode/ext/platform/wp8/BarcodeImpl.targets +35 -0
  350. data/libs/enterprise-barcode/ext/platform/wp8/BarcodeLib.props +18 -0
  351. data/libs/enterprise-barcode/ext/platform/wp8/BarcodeLib.vcxproj +185 -0
  352. data/libs/enterprise-barcode/ext/platform/wp8/BarcodeLib.vcxproj.filters +58 -0
  353. data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.Graphics.Imaging.dll +0 -0
  354. data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.Graphics.Imaging.winmd +0 -0
  355. data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.Graphics.Imaging.xml +4813 -0
  356. data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.InteropServices.WindowsRuntime.dll +0 -0
  357. data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.InteropServices.WindowsRuntime.winmd +0 -0
  358. data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/Nokia.InteropServices.WindowsRuntime.xml +41 -0
  359. data/libs/enterprise-barcode/ext/platform/wp8/lib/ARM/OpticalReaderLib.dll +0 -0
  360. data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib.XML +68 -0
  361. data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib.dll +0 -0
  362. data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/BarcodeReaderLib.csproj +120 -0
  363. data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/BarcodeReaderLib.sln +34 -0
  364. data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/CameraNavigatePage.xaml +32 -0
  365. data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/CameraNavigatePage.xaml.cs +235 -0
  366. data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/OpticalReaderTask.cs +182 -0
  367. data/libs/enterprise-barcode/ext/platform/wp8/lib/BarcodeReaderLib/Properties/AssemblyInfo.cs +37 -0
  368. data/libs/enterprise-barcode/ext/platform/wp8/lib/Nokia.Graphics.Imaging.Managed.dll +0 -0
  369. data/libs/enterprise-barcode/ext/platform/wp8/lib/Nokia.Graphics.Imaging.Managed.xml +341 -0
  370. data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.Graphics.Imaging.dll +0 -0
  371. data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.Graphics.Imaging.winmd +0 -0
  372. data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.Graphics.Imaging.xml +4813 -0
  373. data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.InteropServices.WindowsRuntime.dll +0 -0
  374. data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.InteropServices.WindowsRuntime.winmd +0 -0
  375. data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/Nokia.InteropServices.WindowsRuntime.xml +41 -0
  376. data/libs/enterprise-barcode/ext/platform/wp8/lib/x86/OpticalReaderLib.dll +0 -0
  377. data/libs/enterprise-barcode/ext/platform/wp8/lib/zxing.wp8.0.XML +10324 -0
  378. data/libs/enterprise-barcode/ext/platform/wp8/lib/zxing.wp8.0.dll +0 -0
  379. data/libs/enterprise-barcode/ext/platform/wp8/src/Barcode_impl.cs +630 -0
  380. data/libs/enterprise-barcode/ext/platform/wp8/src/Properties/AssemblyInfo.cs +37 -0
  381. data/libs/enterprise-barcode/public/api/generated/Rho.Barcode.js +772 -0
  382. data/libs/ie/rhobrowser.dll +0 -0
  383. data/libs/nodejs.rb +2 -0
  384. data/libs/nodejs/ext.yml +25 -0
  385. data/libs/nodejs/ext/Nodejs.xml +37 -0
  386. data/libs/nodejs/ext/build +19 -0
  387. data/libs/nodejs/ext/build.bat +29 -0
  388. data/libs/nodejs/ext/platform/android/Rakefile +161 -0
  389. data/libs/nodejs/ext/platform/android/ext_native.files +8 -0
  390. data/libs/nodejs/ext/platform/android/jxCore/jx.h +134 -0
  391. data/libs/nodejs/ext/platform/android/jxCore/jx_result.h +221 -0
  392. data/libs/nodejs/ext/platform/android/jxCore/libcares_arm.a +0 -0
  393. data/libs/nodejs/ext/platform/android/jxCore/libcares_ia32.a +0 -0
  394. data/libs/nodejs/ext/platform/android/jxCore/libcares_x64.a +0 -0
  395. data/libs/nodejs/ext/platform/android/jxCore/libchrome_zlib_arm.a +0 -0
  396. data/libs/nodejs/ext/platform/android/jxCore/libchrome_zlib_ia32.a +0 -0
  397. data/libs/nodejs/ext/platform/android/jxCore/libchrome_zlib_x64.a +0 -0
  398. data/libs/nodejs/ext/platform/android/jxCore/libhttp_parser_arm.a +0 -0
  399. data/libs/nodejs/ext/platform/android/jxCore/libhttp_parser_ia32.a +0 -0
  400. data/libs/nodejs/ext/platform/android/jxCore/libhttp_parser_x64.a +0 -0
  401. data/libs/nodejs/ext/platform/android/jxCore/libjx_arm.a +0 -0
  402. data/libs/nodejs/ext/platform/android/jxCore/libjx_ia32.a +0 -0
  403. data/libs/nodejs/ext/platform/android/jxCore/libjx_x64.a +0 -0
  404. data/libs/nodejs/ext/platform/android/jxCore/libopenssl_arm.a +0 -0
  405. data/libs/nodejs/ext/platform/android/jxCore/libopenssl_ia32.a +0 -0
  406. data/libs/nodejs/ext/platform/android/jxCore/libopenssl_x64.a +0 -0
  407. data/libs/nodejs/ext/platform/android/jxCore/libsqlite3_arm.a +0 -0
  408. data/libs/nodejs/ext/platform/android/jxCore/libsqlite3_ia32.a +0 -0
  409. data/libs/nodejs/ext/platform/android/jxCore/libsqlite3_x64.a +0 -0
  410. data/libs/nodejs/ext/platform/android/jxCore/libuv_arm.a +0 -0
  411. data/libs/nodejs/ext/platform/android/jxCore/libuv_ia32.a +0 -0
  412. data/libs/nodejs/ext/platform/android/jxCore/libuv_x64.a +0 -0
  413. data/libs/nodejs/ext/platform/android/jxCore/libv8_base_arm.a +0 -0
  414. data/libs/nodejs/ext/platform/android/jxCore/libv8_base_ia32.a +0 -0
  415. data/libs/nodejs/ext/platform/android/jxCore/libv8_base_x64.a +0 -0
  416. data/libs/nodejs/ext/platform/android/jxCore/libv8_nosnapshot_arm.a +0 -0
  417. data/libs/nodejs/ext/platform/android/jxCore/libv8_nosnapshot_ia32.a +0 -0
  418. data/libs/nodejs/ext/platform/android/jxCore/libv8_nosnapshot_x64.a +0 -0
  419. data/libs/nodejs/ext/platform/iphone/Nodejs.xcodeproj/project.pbxproj +350 -0
  420. data/libs/nodejs/ext/platform/iphone/Nodejs_Prefix.pch +7 -0
  421. data/libs/nodejs/ext/platform/iphone/Rakefile +73 -0
  422. data/libs/nodejs/ext/platform/iphone/jxCore/jx.h +134 -0
  423. data/libs/nodejs/ext/platform/iphone/jxCore/jx_result.h +221 -0
  424. data/libs/nodejs/ext/platform/iphone/jxCore/libcares.a +0 -0
  425. data/libs/nodejs/ext/platform/iphone/jxCore/libchrome_zlib.a +0 -0
  426. data/libs/nodejs/ext/platform/iphone/jxCore/libhttp_parser.a +0 -0
  427. data/libs/nodejs/ext/platform/iphone/jxCore/libjx.a +0 -0
  428. data/libs/nodejs/ext/platform/iphone/jxCore/libmozjs.a +0 -0
  429. data/libs/nodejs/ext/platform/iphone/jxCore/libopenssl.a +0 -0
  430. data/libs/nodejs/ext/platform/iphone/jxCore/libsqlite3.a +0 -0
  431. data/libs/nodejs/ext/platform/iphone/jxCore/libuv.a +0 -0
  432. data/libs/nodejs/ext/shared/jxcore/jx.h +134 -0
  433. data/libs/nodejs/ext/shared/jxcore/jx_result.h +221 -0
  434. data/libs/nodejs/ext/shared/jxcoretau.cpp +454 -0
  435. data/libs/nodejs/ext/shared/jxcoretau.h +20 -0
  436. data/libs/nodejs/ext/shared/nodejs_impl.cpp +106 -0
  437. data/libs/nodejs/nodejs.rb +2 -0
  438. data/libs/openssl-edge.rb +2 -0
  439. data/libs/openssl-edge/ext.yml +4 -0
  440. data/libs/openssl-edge/ext/Rakefile +145 -0
  441. data/libs/openssl-edge/ext/android/Rakefile +107 -0
  442. data/libs/openssl-edge/ext/android/ext_native.files +32 -0
  443. data/libs/openssl-edge/ext/android/extconf.h +91 -0
  444. data/libs/openssl-edge/ext/build +12 -0
  445. data/libs/openssl-edge/ext/build.bat +5 -0
  446. data/libs/openssl-edge/ext/extconf.rb +141 -0
  447. data/libs/openssl-edge/ext/openssl.pro +109 -0
  448. data/libs/openssl-edge/ext/openssl.sln +52 -0
  449. data/libs/openssl-edge/ext/openssl.vcproj +1010 -0
  450. data/libs/openssl-edge/ext/openssl_missing.c +1163 -0
  451. data/libs/openssl-edge/ext/openssl_missing.h +537 -0
  452. data/libs/openssl-edge/ext/ossl.c +1203 -0
  453. data/libs/openssl-edge/ext/ossl.h +242 -0
  454. data/libs/openssl-edge/ext/ossl_asn1.c +2008 -0
  455. data/libs/openssl-edge/ext/ossl_asn1.h +66 -0
  456. data/libs/openssl-edge/ext/ossl_bio.c +118 -0
  457. data/libs/openssl-edge/ext/ossl_bio.h +19 -0
  458. data/libs/openssl-edge/ext/ossl_bn.c +1153 -0
  459. data/libs/openssl-edge/ext/ossl_bn.h +23 -0
  460. data/libs/openssl-edge/ext/ossl_cipher.c +1085 -0
  461. data/libs/openssl-edge/ext/ossl_cipher.h +20 -0
  462. data/libs/openssl-edge/ext/ossl_config.c +89 -0
  463. data/libs/openssl-edge/ext/ossl_config.h +19 -0
  464. data/libs/openssl-edge/ext/ossl_digest.c +453 -0
  465. data/libs/openssl-edge/ext/ossl_digest.h +20 -0
  466. data/libs/openssl-edge/ext/ossl_engine.c +580 -0
  467. data/libs/openssl-edge/ext/ossl_engine.h +19 -0
  468. data/libs/openssl-edge/ext/ossl_hmac.c +398 -0
  469. data/libs/openssl-edge/ext/ossl_hmac.h +18 -0
  470. data/libs/openssl-edge/ext/ossl_ns_spki.c +406 -0
  471. data/libs/openssl-edge/ext/ossl_ns_spki.h +19 -0
  472. data/libs/openssl-edge/ext/ossl_ocsp.c +2013 -0
  473. data/libs/openssl-edge/ext/ossl_ocsp.h +23 -0
  474. data/libs/openssl-edge/ext/ossl_pkcs12.c +261 -0
  475. data/libs/openssl-edge/ext/ossl_pkcs12.h +13 -0
  476. data/libs/openssl-edge/ext/ossl_pkcs5.c +180 -0
  477. data/libs/openssl-edge/ext/ossl_pkcs5.h +6 -0
  478. data/libs/openssl-edge/ext/ossl_pkcs7.c +1157 -0
  479. data/libs/openssl-edge/ext/ossl_pkcs7.h +20 -0
  480. data/libs/openssl-edge/ext/ossl_pkey.c +469 -0
  481. data/libs/openssl-edge/ext/ossl_pkey.h +245 -0
  482. data/libs/openssl-edge/ext/ossl_pkey_dh.c +650 -0
  483. data/libs/openssl-edge/ext/ossl_pkey_dsa.c +672 -0
  484. data/libs/openssl-edge/ext/ossl_pkey_ec.c +1806 -0
  485. data/libs/openssl-edge/ext/ossl_pkey_rsa.c +768 -0
  486. data/libs/openssl-edge/ext/ossl_rand.c +238 -0
  487. data/libs/openssl-edge/ext/ossl_rand.h +18 -0
  488. data/libs/openssl-edge/ext/ossl_ssl.c +2724 -0
  489. data/libs/openssl-edge/ext/ossl_ssl.h +41 -0
  490. data/libs/openssl-edge/ext/ossl_ssl_session.c +352 -0
  491. data/libs/openssl-edge/ext/ossl_version.h +15 -0
  492. data/libs/openssl-edge/ext/ossl_x509.c +186 -0
  493. data/libs/openssl-edge/ext/ossl_x509.h +119 -0
  494. data/libs/openssl-edge/ext/ossl_x509attr.c +328 -0
  495. data/libs/openssl-edge/ext/ossl_x509cert.c +863 -0
  496. data/libs/openssl-edge/ext/ossl_x509crl.c +565 -0
  497. data/libs/openssl-edge/ext/ossl_x509ext.c +480 -0
  498. data/libs/openssl-edge/ext/ossl_x509name.c +547 -0
  499. data/libs/openssl-edge/ext/ossl_x509req.c +492 -0
  500. data/libs/openssl-edge/ext/ossl_x509revoked.c +279 -0
  501. data/libs/openssl-edge/ext/ossl_x509store.c +846 -0
  502. data/libs/openssl-edge/ext/ruby_missing.h +32 -0
  503. data/libs/openssl-edge/openssl-edge.rb +2 -0
  504. data/libs/openssl-edge/openssl.rb +24 -0
  505. data/libs/openssl-edge/openssl/bn.rb +35 -0
  506. data/libs/openssl-edge/openssl/buffering.rb +341 -0
  507. data/libs/openssl-edge/openssl/cipher.rb +65 -0
  508. data/libs/openssl-edge/openssl/digest.rb +61 -0
  509. data/libs/openssl-edge/openssl/ssl-internal.rb +180 -0
  510. data/libs/openssl-edge/openssl/ssl.rb +1 -0
  511. data/libs/openssl-edge/openssl/x509-internal.rb +153 -0
  512. data/libs/openssl-edge/openssl/x509.rb +1 -0
  513. data/libs/openssl.so-edge.rb +2 -0
  514. data/libs/openssl.so-edge/ext.yml +8 -0
  515. data/libs/openssl.so-edge/ext/Rakefile +140 -0
  516. data/libs/openssl.so-edge/ext/android/armeabi/libcrypto.a +0 -0
  517. data/libs/openssl.so-edge/ext/android/armeabi/libssl.a +0 -0
  518. data/libs/openssl.so-edge/ext/android/x86/libcrypto.a +0 -0
  519. data/libs/openssl.so-edge/ext/android/x86/libssl.a +0 -0
  520. data/libs/openssl.so-edge/ext/build +12 -0
  521. data/libs/openssl.so-edge/ext/build.bat +1 -0
  522. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/dh/dh_locl.h +56 -0
  523. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/dsa/dsa_locl.h +76 -0
  524. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/evp/evp_locl.h +66 -0
  525. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/hmac/hmac_lcl.h +33 -0
  526. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/asn1_int.h +94 -0
  527. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/async.h +14 -0
  528. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/bn_conf.h +28 -0
  529. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/bn_dh.h +17 -0
  530. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/bn_int.h +82 -0
  531. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/bn_srp.h +32 -0
  532. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/chacha.h +49 -0
  533. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/cryptlib.h +81 -0
  534. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/cryptlib_int.h +31 -0
  535. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/dso_conf.h +16 -0
  536. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/engine.h +20 -0
  537. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/err_int.h +17 -0
  538. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/evp_int.h +382 -0
  539. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/md32_common.h +383 -0
  540. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/objects.h +12 -0
  541. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/poly1305.h +19 -0
  542. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/rand.h +20 -0
  543. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/include/internal/x509_int.h +267 -0
  544. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/ocsp/ocsp_lcl.h +216 -0
  545. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/rsa/rsa_locl.h +96 -0
  546. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/crypto/x509/x509_lcl.h +142 -0
  547. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/e_os.h +520 -0
  548. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/bio.h +26 -0
  549. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/comp.h +12 -0
  550. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/conf.h +32 -0
  551. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/constant_time_locl.h +185 -0
  552. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/dane.h +103 -0
  553. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/dso.h +216 -0
  554. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/err.h +15 -0
  555. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/numbers.h +68 -0
  556. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/o_dir.h +63 -0
  557. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/o_str.h +17 -0
  558. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/internal/thread_once.h +42 -0
  559. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/__DECC_INCLUDE_EPILOGUE.H +16 -0
  560. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/__DECC_INCLUDE_PROLOGUE.H +20 -0
  561. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/aes.h +92 -0
  562. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/asn1.h +1096 -0
  563. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/asn1_mac.h +10 -0
  564. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/asn1t.h +924 -0
  565. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/async.h +98 -0
  566. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/bio.h +854 -0
  567. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/blowfish.h +61 -0
  568. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/bn.h +575 -0
  569. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/buffer.h +76 -0
  570. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/camellia.h +83 -0
  571. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/cast.h +53 -0
  572. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/cmac.h +41 -0
  573. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/cms.h +512 -0
  574. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/comp.h +72 -0
  575. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/conf.h +216 -0
  576. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/conf_api.h +40 -0
  577. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/crypto.h +463 -0
  578. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ct.h +518 -0
  579. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/des.h +174 -0
  580. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/dh.h +343 -0
  581. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/dsa.h +282 -0
  582. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/dtls1.h +56 -0
  583. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/e_os2.h +311 -0
  584. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ebcdic.h +33 -0
  585. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ec.h +1581 -0
  586. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ecdh.h +10 -0
  587. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ecdsa.h +10 -0
  588. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/engine.h +842 -0
  589. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/err.h +259 -0
  590. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/evp.h +1586 -0
  591. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/hmac.h +49 -0
  592. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/idea.h +64 -0
  593. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/kdf.h +75 -0
  594. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/lhash.h +204 -0
  595. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/md2.h +44 -0
  596. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/md4.h +51 -0
  597. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/md5.h +50 -0
  598. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/mdc2.h +42 -0
  599. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/modes.h +203 -0
  600. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/obj_mac.h +4577 -0
  601. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/objects.h +1097 -0
  602. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ocsp.h +409 -0
  603. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/opensslconf.h +169 -0
  604. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/opensslconf.h.in +141 -0
  605. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/opensslv.h +105 -0
  606. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ossl_typ.h +190 -0
  607. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/pem.h +501 -0
  608. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/pem2.h +20 -0
  609. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/pkcs12.h +282 -0
  610. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/pkcs7.h +404 -0
  611. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/rand.h +89 -0
  612. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/rc2.h +51 -0
  613. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/rc4.h +36 -0
  614. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/rc5.h +63 -0
  615. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ripemd.h +47 -0
  616. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/rsa.h +588 -0
  617. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/safestack.h +164 -0
  618. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/seed.h +98 -0
  619. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/sha.h +119 -0
  620. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/srp.h +131 -0
  621. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/srtp.h +50 -0
  622. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ssl.h +2527 -0
  623. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ssl2.h +24 -0
  624. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ssl3.h +307 -0
  625. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/stack.h +78 -0
  626. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/symhacks.h +52 -0
  627. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/tls1.h +972 -0
  628. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ts.h +643 -0
  629. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/txt_db.h +57 -0
  630. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/ui.h +368 -0
  631. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/whrlpool.h +48 -0
  632. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/x509.h +1123 -0
  633. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/x509_vfy.h +539 -0
  634. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/openssl/x509v3.h +1005 -0
  635. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/packet_locl.h +555 -0
  636. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/record/record.h +240 -0
  637. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/record/record_locl.h +114 -0
  638. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/ssl_locl.h +2127 -0
  639. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/statem/statem.h +123 -0
  640. data/libs/openssl.so-edge/ext/openssl-1-1-0-stable/include/ssl/statem/statem_locl.h +124 -0
  641. data/libs/openssl.so-edge/openssl.so.rb +2 -0
  642. data/libs/webkit.rb +2 -0
  643. data/libs/webkit/ext.yml +4 -0
  644. data/libs/webkit/ext/build +12 -0
  645. data/libs/webkit/ext/build.bat +7 -0
  646. data/libs/webkit/ext/wm/Rakefile +61 -0
  647. data/libs/webkit/ext/wm/RhoMsgs.cpp +17 -0
  648. data/libs/webkit/ext/wm/RhoMsgs.h +14 -0
  649. data/libs/webkit/ext/wm/RhoWKBrowserEngine.cpp +736 -0
  650. data/libs/webkit/ext/wm/RhoWKBrowserEngine.h +105 -0
  651. data/libs/webkit/ext/wm/lib/npapi/rhobridge.dll +0 -0
  652. data/libs/webkit/ext/wm/lib/rhoengine_defs.h +80 -0
  653. data/libs/webkit/ext/wm/lib/rhowebkit.dll +0 -0
  654. data/libs/webkit/ext/wm/webkit.sln +36 -0
  655. data/libs/webkit/ext/wm/webkit.suo +0 -0
  656. data/libs/webkit/ext/wm/webkit.vcproj +800 -0
  657. data/libs/webkit/ext/wm/webkit.vsprops +20 -0
  658. data/libs/webkit/webkit.rb +2 -0
  659. data/rho-tau-extensions.gemspec +23 -0
  660. data/version +1 -0
  661. metadata +705 -0
@@ -0,0 +1,245 @@
1
+ /*
2
+ * 'OpenSSL for Ruby' project
3
+ * Copyright (C) 2001 Michal Rokos <m.rokos@sh.cvut.cz>
4
+ * All rights reserved.
5
+ */
6
+ /*
7
+ * This program is licensed under the same licence as Ruby.
8
+ * (See the file 'LICENCE'.)
9
+ */
10
+ #if !defined(_OSSL_PKEY_H_)
11
+ #define _OSSL_PKEY_H_
12
+
13
+ extern VALUE mPKey;
14
+ extern VALUE cPKey;
15
+ extern VALUE ePKeyError;
16
+ extern const rb_data_type_t ossl_evp_pkey_type;
17
+
18
+ #define OSSL_PKEY_SET_PRIVATE(obj) rb_iv_set((obj), "private", Qtrue)
19
+ #define OSSL_PKEY_SET_PUBLIC(obj) rb_iv_set((obj), "private", Qfalse)
20
+ #define OSSL_PKEY_IS_PRIVATE(obj) (rb_iv_get((obj), "private") == Qtrue)
21
+
22
+ #define NewPKey(klass) \
23
+ TypedData_Wrap_Struct((klass), &ossl_evp_pkey_type, 0)
24
+ #define SetPKey(obj, pkey) do { \
25
+ if (!(pkey)) { \
26
+ rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!"); \
27
+ } \
28
+ RTYPEDDATA_DATA(obj) = (pkey); \
29
+ OSSL_PKEY_SET_PUBLIC(obj); \
30
+ } while (0)
31
+ #define GetPKey(obj, pkey) do {\
32
+ TypedData_Get_Struct((obj), EVP_PKEY, &ossl_evp_pkey_type, (pkey)); \
33
+ if (!(pkey)) { \
34
+ rb_raise(rb_eRuntimeError, "PKEY wasn't initialized!");\
35
+ } \
36
+ } while (0)
37
+ #define SafeGetPKey(obj, pkey) do { \
38
+ OSSL_Check_Kind((obj), cPKey); \
39
+ GetPKey((obj), (pkey)); \
40
+ } while (0)
41
+
42
+ struct ossl_generate_cb_arg {
43
+ int yield;
44
+ int stop;
45
+ int state;
46
+ };
47
+ int ossl_generate_cb_2(int p, int n, BN_GENCB *cb);
48
+ void ossl_generate_cb_stop(void *ptr);
49
+
50
+ VALUE ossl_pkey_new(EVP_PKEY *);
51
+ VALUE ossl_pkey_new_from_file(VALUE);
52
+ EVP_PKEY *GetPKeyPtr(VALUE);
53
+ EVP_PKEY *DupPKeyPtr(VALUE);
54
+ EVP_PKEY *GetPrivPKeyPtr(VALUE);
55
+ void Init_ossl_pkey(void);
56
+
57
+ /*
58
+ * RSA
59
+ */
60
+ extern VALUE cRSA;
61
+ extern VALUE eRSAError;
62
+
63
+ VALUE ossl_rsa_new(EVP_PKEY *);
64
+ void Init_ossl_rsa(void);
65
+
66
+ /*
67
+ * DSA
68
+ */
69
+ extern VALUE cDSA;
70
+ extern VALUE eDSAError;
71
+
72
+ VALUE ossl_dsa_new(EVP_PKEY *);
73
+ void Init_ossl_dsa(void);
74
+
75
+ /*
76
+ * DH
77
+ */
78
+ extern VALUE cDH;
79
+ extern VALUE eDHError;
80
+
81
+ VALUE ossl_dh_new(EVP_PKEY *);
82
+ void Init_ossl_dh(void);
83
+
84
+ /*
85
+ * EC
86
+ */
87
+ extern VALUE cEC;
88
+ extern VALUE eECError;
89
+ extern VALUE cEC_GROUP;
90
+ extern VALUE eEC_GROUP;
91
+ extern VALUE cEC_POINT;
92
+ extern VALUE eEC_POINT;
93
+ VALUE ossl_ec_new(EVP_PKEY *);
94
+ void Init_ossl_ec(void);
95
+
96
+ #define OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, _name, _get) \
97
+ /* \
98
+ * call-seq: \
99
+ * _keytype##.##_name -> aBN \
100
+ */ \
101
+ static VALUE ossl_##_keytype##_get_##_name(VALUE self) \
102
+ { \
103
+ _type *obj; \
104
+ const BIGNUM *bn; \
105
+ \
106
+ Get##_type(self, obj); \
107
+ _get; \
108
+ if (bn == NULL) \
109
+ return Qnil; \
110
+ return ossl_bn_new(bn); \
111
+ }
112
+
113
+ #define OSSL_PKEY_BN_DEF_GETTER3(_keytype, _type, _group, a1, a2, a3) \
114
+ OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, a1, \
115
+ _type##_get0_##_group(obj, &bn, NULL, NULL)) \
116
+ OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, a2, \
117
+ _type##_get0_##_group(obj, NULL, &bn, NULL)) \
118
+ OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, a3, \
119
+ _type##_get0_##_group(obj, NULL, NULL, &bn))
120
+
121
+ #define OSSL_PKEY_BN_DEF_GETTER2(_keytype, _type, _group, a1, a2) \
122
+ OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, a1, \
123
+ _type##_get0_##_group(obj, &bn, NULL)) \
124
+ OSSL_PKEY_BN_DEF_GETTER0(_keytype, _type, a2, \
125
+ _type##_get0_##_group(obj, NULL, &bn))
126
+
127
+ #define OSSL_PKEY_BN_DEF_SETTER3(_keytype, _type, _group, a1, a2, a3) \
128
+ /* \
129
+ * call-seq: \
130
+ * _keytype##.set_##_group(a1, a2, a3) -> self \
131
+ */ \
132
+ static VALUE ossl_##_keytype##_set_##_group(VALUE self, VALUE v1, VALUE v2, VALUE v3) \
133
+ { \
134
+ _type *obj; \
135
+ BIGNUM *bn1 = NULL, *orig_bn1 = NIL_P(v1) ? NULL : GetBNPtr(v1);\
136
+ BIGNUM *bn2 = NULL, *orig_bn2 = NIL_P(v2) ? NULL : GetBNPtr(v2);\
137
+ BIGNUM *bn3 = NULL, *orig_bn3 = NIL_P(v3) ? NULL : GetBNPtr(v3);\
138
+ \
139
+ Get##_type(self, obj); \
140
+ if (orig_bn1 && !(bn1 = BN_dup(orig_bn1)) || \
141
+ orig_bn2 && !(bn2 = BN_dup(orig_bn2)) || \
142
+ orig_bn3 && !(bn3 = BN_dup(orig_bn3))) { \
143
+ BN_clear_free(bn1); \
144
+ BN_clear_free(bn2); \
145
+ BN_clear_free(bn3); \
146
+ ossl_raise(eBNError, NULL); \
147
+ } \
148
+ \
149
+ if (!_type##_set0_##_group(obj, bn1, bn2, bn3)) { \
150
+ BN_clear_free(bn1); \
151
+ BN_clear_free(bn2); \
152
+ BN_clear_free(bn3); \
153
+ ossl_raise(ePKeyError, #_type"_set0_"#_group); \
154
+ } \
155
+ return self; \
156
+ }
157
+
158
+ #define OSSL_PKEY_BN_DEF_SETTER2(_keytype, _type, _group, a1, a2) \
159
+ /* \
160
+ * call-seq: \
161
+ * _keytype##.set_##_group(a1, a2) -> self \
162
+ */ \
163
+ static VALUE ossl_##_keytype##_set_##_group(VALUE self, VALUE v1, VALUE v2) \
164
+ { \
165
+ _type *obj; \
166
+ BIGNUM *bn1 = NULL, *orig_bn1 = NIL_P(v1) ? NULL : GetBNPtr(v1);\
167
+ BIGNUM *bn2 = NULL, *orig_bn2 = NIL_P(v2) ? NULL : GetBNPtr(v2);\
168
+ \
169
+ Get##_type(self, obj); \
170
+ if (orig_bn1 && !(bn1 = BN_dup(orig_bn1)) || \
171
+ orig_bn2 && !(bn2 = BN_dup(orig_bn2))) { \
172
+ BN_clear_free(bn1); \
173
+ BN_clear_free(bn2); \
174
+ ossl_raise(eBNError, NULL); \
175
+ } \
176
+ \
177
+ if (!_type##_set0_##_group(obj, bn1, bn2)) { \
178
+ BN_clear_free(bn1); \
179
+ BN_clear_free(bn2); \
180
+ ossl_raise(ePKeyError, #_type"_set0_"#_group); \
181
+ } \
182
+ return self; \
183
+ }
184
+
185
+ #define OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, _name) \
186
+ /* \
187
+ * call-seq: \
188
+ * _keytype##.##_name = bn -> bn \
189
+ */ \
190
+ static VALUE ossl_##_keytype##_set_##_name(VALUE self, VALUE bignum) \
191
+ { \
192
+ _type *obj; \
193
+ BIGNUM *bn; \
194
+ \
195
+ rb_warning("#"#_name"= is deprecated; use #set_"#_group); \
196
+ Get##_type(self, obj); \
197
+ if (NIL_P(bignum)) { \
198
+ BN_clear_free(obj->_name); \
199
+ obj->_name = NULL; \
200
+ return Qnil; \
201
+ } \
202
+ \
203
+ bn = GetBNPtr(bignum); \
204
+ if (obj->_name == NULL) \
205
+ obj->_name = BN_new(); \
206
+ if (obj->_name == NULL) \
207
+ ossl_raise(eBNError, NULL); \
208
+ if (BN_copy(obj->_name, bn) == NULL) \
209
+ ossl_raise(eBNError, NULL); \
210
+ return bignum; \
211
+ }
212
+
213
+ #if defined(HAVE_OPAQUE_OPENSSL) /* OpenSSL 1.1.0 */
214
+ #define OSSL_PKEY_BN_DEF3(_keytype, _type, _group, a1, a2, a3) \
215
+ OSSL_PKEY_BN_DEF_GETTER3(_keytype, _type, _group, a1, a2, a3) \
216
+ OSSL_PKEY_BN_DEF_SETTER3(_keytype, _type, _group, a1, a2, a3)
217
+
218
+ #define OSSL_PKEY_BN_DEF2(_keytype, _type, _group, a1, a2) \
219
+ OSSL_PKEY_BN_DEF_GETTER2(_keytype, _type, _group, a1, a2) \
220
+ OSSL_PKEY_BN_DEF_SETTER2(_keytype, _type, _group, a1, a2)
221
+
222
+ #define DEF_OSSL_PKEY_BN(class, keytype, name) \
223
+ rb_define_method((class), #name, ossl_##keytype##_get_##name, 0)
224
+
225
+ #else
226
+ #define OSSL_PKEY_BN_DEF3(_keytype, _type, _group, a1, a2, a3) \
227
+ OSSL_PKEY_BN_DEF_GETTER3(_keytype, _type, _group, a1, a2, a3) \
228
+ OSSL_PKEY_BN_DEF_SETTER3(_keytype, _type, _group, a1, a2, a3) \
229
+ OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, a1) \
230
+ OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, a2) \
231
+ OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, a3)
232
+
233
+ #define OSSL_PKEY_BN_DEF2(_keytype, _type, _group, a1, a2) \
234
+ OSSL_PKEY_BN_DEF_GETTER2(_keytype, _type, _group, a1, a2) \
235
+ OSSL_PKEY_BN_DEF_SETTER2(_keytype, _type, _group, a1, a2) \
236
+ OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, a1) \
237
+ OSSL_PKEY_BN_DEF_SETTER_OLD(_keytype, _type, _group, a2)
238
+
239
+ #define DEF_OSSL_PKEY_BN(class, keytype, name) do { \
240
+ rb_define_method((class), #name, ossl_##keytype##_get_##name, 0);\
241
+ rb_define_method((class), #name "=", ossl_##keytype##_set_##name, 1);\
242
+ } while (0)
243
+ #endif /* HAVE_OPAQUE_OPENSSL */
244
+
245
+ #endif /* _OSSL_PKEY_H_ */
@@ -0,0 +1,650 @@
1
+ /*
2
+ * 'OpenSSL for Ruby' project
3
+ * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
4
+ * All rights reserved.
5
+ */
6
+ /*
7
+ * This program is licensed under the same licence as Ruby.
8
+ * (See the file 'LICENCE'.)
9
+ */
10
+ #include "ossl.h"
11
+
12
+ #if !defined(OPENSSL_NO_DH)
13
+
14
+ #define GetPKeyDH(obj, pkey) do { \
15
+ GetPKey((obj), (pkey)); \
16
+ if (EVP_PKEY_base_id(pkey) != EVP_PKEY_DH) { /* PARANOIA? */ \
17
+ ossl_raise(rb_eRuntimeError, "THIS IS NOT A DH!") ; \
18
+ } \
19
+ } while (0)
20
+ #define GetDH(obj, dh) do { \
21
+ EVP_PKEY *_pkey; \
22
+ GetPKeyDH((obj), _pkey); \
23
+ (dh) = EVP_PKEY_get0_DH(_pkey); \
24
+ } while (0)
25
+
26
+ /*
27
+ * Classes
28
+ */
29
+ VALUE cDH;
30
+ VALUE eDHError;
31
+
32
+ /*
33
+ * Public
34
+ */
35
+ static VALUE
36
+ dh_instance(VALUE klass, DH *dh)
37
+ {
38
+ EVP_PKEY *pkey;
39
+ VALUE obj;
40
+
41
+ if (!dh) {
42
+ return Qfalse;
43
+ }
44
+ obj = NewPKey(klass);
45
+ if (!(pkey = EVP_PKEY_new())) {
46
+ return Qfalse;
47
+ }
48
+ if (!EVP_PKEY_assign_DH(pkey, dh)) {
49
+ EVP_PKEY_free(pkey);
50
+ return Qfalse;
51
+ }
52
+ SetPKey(obj, pkey);
53
+
54
+ return obj;
55
+ }
56
+
57
+ VALUE
58
+ ossl_dh_new(EVP_PKEY *pkey)
59
+ {
60
+ VALUE obj;
61
+
62
+ if (!pkey) {
63
+ obj = dh_instance(cDH, DH_new());
64
+ } else {
65
+ obj = NewPKey(cDH);
66
+ if (EVP_PKEY_base_id(pkey) != EVP_PKEY_DH) {
67
+ ossl_raise(rb_eTypeError, "Not a DH key!");
68
+ }
69
+ SetPKey(obj, pkey);
70
+ }
71
+ if (obj == Qfalse) {
72
+ ossl_raise(eDHError, NULL);
73
+ }
74
+
75
+ return obj;
76
+ }
77
+
78
+ /*
79
+ * Private
80
+ */
81
+ struct dh_blocking_gen_arg {
82
+ DH *dh;
83
+ int size;
84
+ int gen;
85
+ BN_GENCB *cb;
86
+ int result;
87
+ };
88
+
89
+ static void *
90
+ dh_blocking_gen(void *arg)
91
+ {
92
+ struct dh_blocking_gen_arg *gen = (struct dh_blocking_gen_arg *)arg;
93
+ gen->result = DH_generate_parameters_ex(gen->dh, gen->size, gen->gen, gen->cb);
94
+ return 0;
95
+ }
96
+
97
+ static DH *
98
+ dh_generate(int size, int gen)
99
+ {
100
+ struct ossl_generate_cb_arg cb_arg = { 0 };
101
+ struct dh_blocking_gen_arg gen_arg;
102
+ DH *dh = DH_new();
103
+ BN_GENCB *cb = BN_GENCB_new();
104
+
105
+ if (!dh || !cb) {
106
+ DH_free(dh);
107
+ BN_GENCB_free(cb);
108
+ return NULL;
109
+ }
110
+
111
+ if (rb_block_given_p())
112
+ cb_arg.yield = 1;
113
+ BN_GENCB_set(cb, ossl_generate_cb_2, &cb_arg);
114
+ gen_arg.dh = dh;
115
+ gen_arg.size = size;
116
+ gen_arg.gen = gen;
117
+ gen_arg.cb = cb;
118
+ if (cb_arg.yield == 1) {
119
+ /* we cannot release GVL when callback proc is supplied */
120
+ dh_blocking_gen(&gen_arg);
121
+ } else {
122
+ /* there's a chance to unblock */
123
+ rb_thread_call_without_gvl(dh_blocking_gen, &gen_arg, ossl_generate_cb_stop, &cb_arg);
124
+ }
125
+
126
+ BN_GENCB_free(cb);
127
+ if (!gen_arg.result) {
128
+ DH_free(dh);
129
+ if (cb_arg.state) {
130
+ /* Clear OpenSSL error queue before re-raising. */
131
+ ossl_clear_error();
132
+ rb_jump_tag(cb_arg.state);
133
+ }
134
+ return NULL;
135
+ }
136
+
137
+ if (!DH_generate_key(dh)) {
138
+ DH_free(dh);
139
+ return NULL;
140
+ }
141
+
142
+ return dh;
143
+ }
144
+
145
+ /*
146
+ * call-seq:
147
+ * DH.generate(size [, generator]) -> dh
148
+ *
149
+ * Creates a new DH instance from scratch by generating the private and public
150
+ * components alike.
151
+ *
152
+ * === Parameters
153
+ * * +size+ is an integer representing the desired key size. Keys smaller than 1024 bits should be considered insecure.
154
+ * * +generator+ is a small number > 1, typically 2 or 5.
155
+ *
156
+ */
157
+ static VALUE
158
+ ossl_dh_s_generate(int argc, VALUE *argv, VALUE klass)
159
+ {
160
+ DH *dh ;
161
+ int g = 2;
162
+ VALUE size, gen, obj;
163
+
164
+ if (rb_scan_args(argc, argv, "11", &size, &gen) == 2) {
165
+ g = NUM2INT(gen);
166
+ }
167
+ dh = dh_generate(NUM2INT(size), g);
168
+ obj = dh_instance(klass, dh);
169
+ if (obj == Qfalse) {
170
+ DH_free(dh);
171
+ ossl_raise(eDHError, NULL);
172
+ }
173
+
174
+ return obj;
175
+ }
176
+
177
+ /*
178
+ * call-seq:
179
+ * DH.new -> dh
180
+ * DH.new(string) -> dh
181
+ * DH.new(size [, generator]) -> dh
182
+ *
183
+ * Either generates a DH instance from scratch or by reading already existing
184
+ * DH parameters from +string+. Note that when reading a DH instance from
185
+ * data that was encoded from a DH instance by using DH#to_pem or DH#to_der
186
+ * the result will *not* contain a public/private key pair yet. This needs to
187
+ * be generated using DH#generate_key! first.
188
+ *
189
+ * === Parameters
190
+ * * +size+ is an integer representing the desired key size. Keys smaller than 1024 bits should be considered insecure.
191
+ * * +generator+ is a small number > 1, typically 2 or 5.
192
+ * * +string+ contains the DER or PEM encoded key.
193
+ *
194
+ * === Examples
195
+ * DH.new # -> dh
196
+ * DH.new(1024) # -> dh
197
+ * DH.new(1024, 5) # -> dh
198
+ * #Reading DH parameters
199
+ * dh = DH.new(File.read('parameters.pem')) # -> dh, but no public/private key yet
200
+ * dh.generate_key! # -> dh with public and private key
201
+ */
202
+ static VALUE
203
+ ossl_dh_initialize(int argc, VALUE *argv, VALUE self)
204
+ {
205
+ EVP_PKEY *pkey;
206
+ DH *dh;
207
+ int g = 2;
208
+ BIO *in;
209
+ VALUE arg, gen;
210
+
211
+ GetPKey(self, pkey);
212
+ if(rb_scan_args(argc, argv, "02", &arg, &gen) == 0) {
213
+ dh = DH_new();
214
+ }
215
+ else if (RB_INTEGER_TYPE_P(arg)) {
216
+ if (!NIL_P(gen)) {
217
+ g = NUM2INT(gen);
218
+ }
219
+ if (!(dh = dh_generate(NUM2INT(arg), g))) {
220
+ ossl_raise(eDHError, NULL);
221
+ }
222
+ }
223
+ else {
224
+ arg = ossl_to_der_if_possible(arg);
225
+ in = ossl_obj2bio(arg);
226
+ dh = PEM_read_bio_DHparams(in, NULL, NULL, NULL);
227
+ if (!dh){
228
+ OSSL_BIO_reset(in);
229
+ dh = d2i_DHparams_bio(in, NULL);
230
+ }
231
+ BIO_free(in);
232
+ if (!dh) {
233
+ ossl_raise(eDHError, NULL);
234
+ }
235
+ }
236
+ if (!EVP_PKEY_assign_DH(pkey, dh)) {
237
+ DH_free(dh);
238
+ ossl_raise(eDHError, NULL);
239
+ }
240
+ return self;
241
+ }
242
+
243
+ static VALUE
244
+ ossl_dh_initialize_copy(VALUE self, VALUE other)
245
+ {
246
+ EVP_PKEY *pkey;
247
+ DH *dh, *dh_other;
248
+ const BIGNUM *pub, *priv;
249
+
250
+ GetPKey(self, pkey);
251
+ if (EVP_PKEY_base_id(pkey) != EVP_PKEY_NONE)
252
+ ossl_raise(eDHError, "DH already initialized");
253
+ GetDH(other, dh_other);
254
+
255
+ dh = DHparams_dup(dh_other);
256
+ if (!dh)
257
+ ossl_raise(eDHError, "DHparams_dup");
258
+ EVP_PKEY_assign_DH(pkey, dh);
259
+
260
+ DH_get0_key(dh_other, &pub, &priv);
261
+ if (pub) {
262
+ BIGNUM *pub2 = BN_dup(pub);
263
+ BIGNUM *priv2 = BN_dup(priv);
264
+
265
+ if (!pub2 || priv && !priv2) {
266
+ BN_clear_free(pub2);
267
+ BN_clear_free(priv2);
268
+ ossl_raise(eDHError, "BN_dup");
269
+ }
270
+ DH_set0_key(dh, pub2, priv2);
271
+ }
272
+
273
+ return self;
274
+ }
275
+
276
+ /*
277
+ * call-seq:
278
+ * dh.public? -> true | false
279
+ *
280
+ * Indicates whether this DH instance has a public key associated with it or
281
+ * not. The public key may be retrieved with DH#pub_key.
282
+ */
283
+ static VALUE
284
+ ossl_dh_is_public(VALUE self)
285
+ {
286
+ DH *dh;
287
+ const BIGNUM *bn;
288
+
289
+ GetDH(self, dh);
290
+ DH_get0_key(dh, &bn, NULL);
291
+
292
+ return bn ? Qtrue : Qfalse;
293
+ }
294
+
295
+ /*
296
+ * call-seq:
297
+ * dh.private? -> true | false
298
+ *
299
+ * Indicates whether this DH instance has a private key associated with it or
300
+ * not. The private key may be retrieved with DH#priv_key.
301
+ */
302
+ static VALUE
303
+ ossl_dh_is_private(VALUE self)
304
+ {
305
+ DH *dh;
306
+ const BIGNUM *bn;
307
+
308
+ GetDH(self, dh);
309
+ DH_get0_key(dh, NULL, &bn);
310
+
311
+ #if !defined(OPENSSL_NO_ENGINE)
312
+ return (bn || DH_get0_engine(dh)) ? Qtrue : Qfalse;
313
+ #else
314
+ return bn ? Qtrue : Qfalse;
315
+ #endif
316
+ }
317
+
318
+ /*
319
+ * call-seq:
320
+ * dh.export -> aString
321
+ * dh.to_pem -> aString
322
+ * dh.to_s -> aString
323
+ *
324
+ * Encodes this DH to its PEM encoding. Note that any existing per-session
325
+ * public/private keys will *not* get encoded, just the Diffie-Hellman
326
+ * parameters will be encoded.
327
+ */
328
+ static VALUE
329
+ ossl_dh_export(VALUE self)
330
+ {
331
+ DH *dh;
332
+ BIO *out;
333
+ VALUE str;
334
+
335
+ GetDH(self, dh);
336
+ if (!(out = BIO_new(BIO_s_mem()))) {
337
+ ossl_raise(eDHError, NULL);
338
+ }
339
+ if (!PEM_write_bio_DHparams(out, dh)) {
340
+ BIO_free(out);
341
+ ossl_raise(eDHError, NULL);
342
+ }
343
+ str = ossl_membio2str(out);
344
+
345
+ return str;
346
+ }
347
+
348
+ /*
349
+ * call-seq:
350
+ * dh.to_der -> aString
351
+ *
352
+ * Encodes this DH to its DER encoding. Note that any existing per-session
353
+ * public/private keys will *not* get encoded, just the Diffie-Hellman
354
+ * parameters will be encoded.
355
+
356
+ */
357
+ static VALUE
358
+ ossl_dh_to_der(VALUE self)
359
+ {
360
+ DH *dh;
361
+ unsigned char *p;
362
+ long len;
363
+ VALUE str;
364
+
365
+ GetDH(self, dh);
366
+ if((len = i2d_DHparams(dh, NULL)) <= 0)
367
+ ossl_raise(eDHError, NULL);
368
+ str = rb_str_new(0, len);
369
+ p = (unsigned char *)RSTRING_PTR(str);
370
+ if(i2d_DHparams(dh, &p) < 0)
371
+ ossl_raise(eDHError, NULL);
372
+ ossl_str_adjust(str, p);
373
+
374
+ return str;
375
+ }
376
+
377
+ /*
378
+ * call-seq:
379
+ * dh.params -> hash
380
+ *
381
+ * Stores all parameters of key to the hash
382
+ * INSECURE: PRIVATE INFORMATIONS CAN LEAK OUT!!!
383
+ * Don't use :-)) (I's up to you)
384
+ */
385
+ static VALUE
386
+ ossl_dh_get_params(VALUE self)
387
+ {
388
+ DH *dh;
389
+ VALUE hash;
390
+ const BIGNUM *p, *q, *g, *pub_key, *priv_key;
391
+
392
+ GetDH(self, dh);
393
+ DH_get0_pqg(dh, &p, &q, &g);
394
+ DH_get0_key(dh, &pub_key, &priv_key);
395
+
396
+ hash = rb_hash_new();
397
+ rb_hash_aset(hash, rb_str_new2("p"), ossl_bn_new(p));
398
+ rb_hash_aset(hash, rb_str_new2("q"), ossl_bn_new(q));
399
+ rb_hash_aset(hash, rb_str_new2("g"), ossl_bn_new(g));
400
+ rb_hash_aset(hash, rb_str_new2("pub_key"), ossl_bn_new(pub_key));
401
+ rb_hash_aset(hash, rb_str_new2("priv_key"), ossl_bn_new(priv_key));
402
+
403
+ return hash;
404
+ }
405
+
406
+ /*
407
+ * call-seq:
408
+ * dh.to_text -> aString
409
+ *
410
+ * Prints all parameters of key to buffer
411
+ * INSECURE: PRIVATE INFORMATIONS CAN LEAK OUT!!!
412
+ * Don't use :-)) (I's up to you)
413
+ */
414
+ static VALUE
415
+ ossl_dh_to_text(VALUE self)
416
+ {
417
+ DH *dh;
418
+ BIO *out;
419
+ VALUE str;
420
+
421
+ GetDH(self, dh);
422
+ if (!(out = BIO_new(BIO_s_mem()))) {
423
+ ossl_raise(eDHError, NULL);
424
+ }
425
+ if (!DHparams_print(out, dh)) {
426
+ BIO_free(out);
427
+ ossl_raise(eDHError, NULL);
428
+ }
429
+ str = ossl_membio2str(out);
430
+
431
+ return str;
432
+ }
433
+
434
+ /*
435
+ * call-seq:
436
+ * dh.public_key -> aDH
437
+ *
438
+ * Returns a new DH instance that carries just the public information, i.e.
439
+ * the prime +p+ and the generator +g+, but no public/private key yet. Such
440
+ * a pair may be generated using DH#generate_key!. The "public key" needed
441
+ * for a key exchange with DH#compute_key is considered as per-session
442
+ * information and may be retrieved with DH#pub_key once a key pair has
443
+ * been generated.
444
+ * If the current instance already contains private information (and thus a
445
+ * valid public/private key pair), this information will no longer be present
446
+ * in the new instance generated by DH#public_key. This feature is helpful for
447
+ * publishing the Diffie-Hellman parameters without leaking any of the private
448
+ * per-session information.
449
+ *
450
+ * === Example
451
+ * dh = OpenSSL::PKey::DH.new(2048) # has public and private key set
452
+ * public_key = dh.public_key # contains only prime and generator
453
+ * parameters = public_key.to_der # it's safe to publish this
454
+ */
455
+ static VALUE
456
+ ossl_dh_to_public_key(VALUE self)
457
+ {
458
+ DH *orig_dh, *dh;
459
+ VALUE obj;
460
+
461
+ GetDH(self, orig_dh);
462
+ dh = DHparams_dup(orig_dh); /* err check perfomed by dh_instance */
463
+ obj = dh_instance(CLASS_OF(self), dh);
464
+ if (obj == Qfalse) {
465
+ DH_free(dh);
466
+ ossl_raise(eDHError, NULL);
467
+ }
468
+
469
+ return obj;
470
+ }
471
+
472
+ /*
473
+ * call-seq:
474
+ * dh.params_ok? -> true | false
475
+ *
476
+ * Validates the Diffie-Hellman parameters associated with this instance.
477
+ * It checks whether a safe prime and a suitable generator are used. If this
478
+ * is not the case, +false+ is returned.
479
+ */
480
+ static VALUE
481
+ ossl_dh_check_params(VALUE self)
482
+ {
483
+ DH *dh;
484
+ int codes;
485
+
486
+ GetDH(self, dh);
487
+ if (!DH_check(dh, &codes)) {
488
+ return Qfalse;
489
+ }
490
+
491
+ return codes == 0 ? Qtrue : Qfalse;
492
+ }
493
+
494
+ /*
495
+ * call-seq:
496
+ * dh.generate_key! -> self
497
+ *
498
+ * Generates a private and public key unless a private key already exists.
499
+ * If this DH instance was generated from public DH parameters (e.g. by
500
+ * encoding the result of DH#public_key), then this method needs to be
501
+ * called first in order to generate the per-session keys before performing
502
+ * the actual key exchange.
503
+ *
504
+ * === Example
505
+ * dh = OpenSSL::PKey::DH.new(2048)
506
+ * public_key = dh.public_key #contains no private/public key yet
507
+ * public_key.generate_key!
508
+ * puts public_key.private? # => true
509
+ */
510
+ static VALUE
511
+ ossl_dh_generate_key(VALUE self)
512
+ {
513
+ DH *dh;
514
+
515
+ GetDH(self, dh);
516
+ if (!DH_generate_key(dh))
517
+ ossl_raise(eDHError, "Failed to generate key");
518
+ return self;
519
+ }
520
+
521
+ /*
522
+ * call-seq:
523
+ * dh.compute_key(pub_bn) -> aString
524
+ *
525
+ * Returns a String containing a shared secret computed from the other party's public value.
526
+ * See DH_compute_key() for further information.
527
+ *
528
+ * === Parameters
529
+ * * +pub_bn+ is a OpenSSL::BN, *not* the DH instance returned by
530
+ * DH#public_key as that contains the DH parameters only.
531
+ */
532
+ static VALUE
533
+ ossl_dh_compute_key(VALUE self, VALUE pub)
534
+ {
535
+ DH *dh;
536
+ const BIGNUM *pub_key, *dh_p;
537
+ VALUE str;
538
+ int len;
539
+
540
+ GetDH(self, dh);
541
+ DH_get0_pqg(dh, &dh_p, NULL, NULL);
542
+ if (!dh_p)
543
+ ossl_raise(eDHError, "incomplete DH");
544
+ pub_key = GetBNPtr(pub);
545
+ len = DH_size(dh);
546
+ str = rb_str_new(0, len);
547
+ if ((len = DH_compute_key((unsigned char *)RSTRING_PTR(str), pub_key, dh)) < 0) {
548
+ ossl_raise(eDHError, NULL);
549
+ }
550
+ rb_str_set_len(str, len);
551
+
552
+ return str;
553
+ }
554
+
555
+ /*
556
+ * Document-method: OpenSSL::PKey::DH#set_pqg
557
+ * call-seq:
558
+ * dh.set_pqg(p, q, g) -> self
559
+ *
560
+ * Sets +p+, +q+, +g+ for the DH instance.
561
+ */
562
+ OSSL_PKEY_BN_DEF3(dh, DH, pqg, p, q, g)
563
+ /*
564
+ * Document-method: OpenSSL::PKey::DH#set_key
565
+ * call-seq:
566
+ * dh.set_key(pub_key, priv_key) -> self
567
+ *
568
+ * Sets +pub_key+ and +priv_key+ for the DH instance. +priv_key+ may be nil.
569
+ */
570
+ OSSL_PKEY_BN_DEF2(dh, DH, key, pub_key, priv_key)
571
+
572
+ /*
573
+ * INIT
574
+ */
575
+ void
576
+ Init_ossl_dh(void)
577
+ {
578
+ #if 0
579
+ mPKey = rb_define_module_under(mOSSL, "PKey");
580
+ cPKey = rb_define_class_under(mPKey, "PKey", rb_cObject);
581
+ ePKeyError = rb_define_class_under(mPKey, "PKeyError", eOSSLError);
582
+ #endif
583
+
584
+ /* Document-class: OpenSSL::PKey::DHError
585
+ *
586
+ * Generic exception that is raised if an operation on a DH PKey
587
+ * fails unexpectedly or in case an instantiation of an instance of DH
588
+ * fails due to non-conformant input data.
589
+ */
590
+ eDHError = rb_define_class_under(mPKey, "DHError", ePKeyError);
591
+ /* Document-class: OpenSSL::PKey::DH
592
+ *
593
+ * An implementation of the Diffie-Hellman key exchange protocol based on
594
+ * discrete logarithms in finite fields, the same basis that DSA is built
595
+ * on.
596
+ *
597
+ * === Accessor methods for the Diffie-Hellman parameters
598
+ * DH#p::
599
+ * The prime (an OpenSSL::BN) of the Diffie-Hellman parameters.
600
+ * DH#g::
601
+ * The generator (an OpenSSL::BN) g of the Diffie-Hellman parameters.
602
+ * DH#pub_key::
603
+ * The per-session public key (an OpenSSL::BN) matching the private key.
604
+ * This needs to be passed to DH#compute_key.
605
+ * DH#priv_key::
606
+ * The per-session private key, an OpenSSL::BN.
607
+ *
608
+ * === Example of a key exchange
609
+ * dh1 = OpenSSL::PKey::DH.new(2048)
610
+ * der = dh1.public_key.to_der #you may send this publicly to the participating party
611
+ * dh2 = OpenSSL::PKey::DH.new(der)
612
+ * dh2.generate_key! #generate the per-session key pair
613
+ * symm_key1 = dh1.compute_key(dh2.pub_key)
614
+ * symm_key2 = dh2.compute_key(dh1.pub_key)
615
+ *
616
+ * puts symm_key1 == symm_key2 # => true
617
+ */
618
+ cDH = rb_define_class_under(mPKey, "DH", cPKey);
619
+ rb_define_singleton_method(cDH, "generate", ossl_dh_s_generate, -1);
620
+ rb_define_method(cDH, "initialize", ossl_dh_initialize, -1);
621
+ rb_define_copy_func(cDH, ossl_dh_initialize_copy);
622
+ rb_define_method(cDH, "public?", ossl_dh_is_public, 0);
623
+ rb_define_method(cDH, "private?", ossl_dh_is_private, 0);
624
+ rb_define_method(cDH, "to_text", ossl_dh_to_text, 0);
625
+ rb_define_method(cDH, "export", ossl_dh_export, 0);
626
+ rb_define_alias(cDH, "to_pem", "export");
627
+ rb_define_alias(cDH, "to_s", "export");
628
+ rb_define_method(cDH, "to_der", ossl_dh_to_der, 0);
629
+ rb_define_method(cDH, "public_key", ossl_dh_to_public_key, 0);
630
+ rb_define_method(cDH, "params_ok?", ossl_dh_check_params, 0);
631
+ rb_define_method(cDH, "generate_key!", ossl_dh_generate_key, 0);
632
+ rb_define_method(cDH, "compute_key", ossl_dh_compute_key, 1);
633
+
634
+ DEF_OSSL_PKEY_BN(cDH, dh, p);
635
+ DEF_OSSL_PKEY_BN(cDH, dh, q);
636
+ DEF_OSSL_PKEY_BN(cDH, dh, g);
637
+ DEF_OSSL_PKEY_BN(cDH, dh, pub_key);
638
+ DEF_OSSL_PKEY_BN(cDH, dh, priv_key);
639
+ rb_define_method(cDH, "set_pqg", ossl_dh_set_pqg, 3);
640
+ rb_define_method(cDH, "set_key", ossl_dh_set_key, 2);
641
+
642
+ rb_define_method(cDH, "params", ossl_dh_get_params, 0);
643
+ }
644
+
645
+ #else /* defined NO_DH */
646
+ void
647
+ Init_ossl_dh(void)
648
+ {
649
+ }
650
+ #endif /* NO_DH */