tdiary 5.6.1 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -0
  3. data/Gemfile.lock +60 -57
  4. data/doc/HOWTO-authenticate-in-rack.md +3 -3
  5. data/js/00default.js +22 -12
  6. data/js/caretposition.js +1 -0
  7. data/js/draft.js +82 -5
  8. data/js/image.js +2 -4
  9. data/js/preview.js +12 -50
  10. data/js/update.js +54 -0
  11. data/js/update_preview.js +79 -0
  12. data/lib/aws/pa_api.rb +7 -7
  13. data/lib/tdiary/admin.rb +66 -3
  14. data/lib/tdiary/cli.rb +14 -10
  15. data/lib/tdiary/core_ext.rb +46 -8
  16. data/lib/tdiary/dispatcher/update_main.rb +6 -0
  17. data/lib/tdiary/io/plugin_pstore.rb +2 -1
  18. data/lib/tdiary/plugin/00default.rb +3 -0
  19. data/lib/tdiary/rack/auth/basic.rb +72 -9
  20. data/lib/tdiary/tasks/auth.rake +2 -4
  21. data/lib/tdiary/tasks/release.rake +5 -4
  22. data/lib/tdiary/version.rb +1 -1
  23. data/lib/tdiary.rb +3 -0
  24. data/misc/plugin/amazon.rb +19 -8
  25. data/misc/plugin/amazon_rakuten.rb +10 -6
  26. data/misc/plugin/draft.rb +11 -3
  27. data/misc/plugin/en/preview.rb +0 -2
  28. data/misc/plugin/image.rb +6 -11
  29. data/misc/plugin/ja/preview.rb +0 -2
  30. data/misc/plugin/makerss.rb +2 -2
  31. data/misc/plugin/my-sequel.rb +1 -0
  32. data/misc/plugin/preview.rb +0 -8
  33. data/theme/base.css +32 -2
  34. data/theme/conf.css +60 -0
  35. data/vendor/bundle/ruby/3.4.0/cache/bcrypt-3.1.22.gem +0 -0
  36. data/vendor/bundle/ruby/3.4.0/cache/date-3.6.0.gem +0 -0
  37. data/vendor/bundle/ruby/3.4.0/cache/fastimage-2.4.3.gem +0 -0
  38. data/vendor/bundle/ruby/3.4.0/cache/net-imap-0.6.8.gem +0 -0
  39. data/vendor/bundle/ruby/3.4.0/cache/net-protocol-0.4.0.gem +0 -0
  40. data/vendor/bundle/ruby/3.4.0/cache/net-smtp-0.5.2.gem +0 -0
  41. data/vendor/bundle/ruby/3.4.0/cache/pstore-0.3.0.gem +0 -0
  42. data/vendor/bundle/ruby/3.4.0/cache/rack-3.2.8.gem +0 -0
  43. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bcrypt-3.1.22/bcrypt_ext.so +0 -0
  44. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bcrypt-3.1.22/gem_make.out +28 -0
  45. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/cgi-0.5.2/cgi/escape.so +0 -0
  46. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/cgi-0.5.2/gem_make.out +6 -6
  47. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/date_core.so +0 -0
  48. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/gem.build_complete +0 -0
  49. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/gem_make.out +26 -0
  50. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/mkmf.log +140 -0
  51. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/CHANGELOG +127 -0
  52. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/COPYING +28 -0
  53. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/README.md +192 -0
  54. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/jruby/bcrypt_jruby/BCrypt.java +926 -0
  55. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/Makefile +273 -0
  56. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/bcrypt_ext.c +125 -0
  57. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt.c +57 -0
  58. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt.h +24 -0
  59. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_blowfish.c +903 -0
  60. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_blowfish.h +27 -0
  61. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_gensalt.c +124 -0
  62. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_gensalt.h +30 -0
  63. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/extconf.rb +22 -0
  64. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/ow-crypt.h +43 -0
  65. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/wrapper.c +554 -0
  66. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/x86.S +203 -0
  67. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/engine.rb +134 -0
  68. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/error.rb +22 -0
  69. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/password.rb +106 -0
  70. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt.rb +16 -0
  71. data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt_ext.so +0 -0
  72. data/vendor/bundle/ruby/3.4.0/gems/cgi-0.5.2/ext/cgi/escape/Makefile +3 -3
  73. data/vendor/bundle/ruby/3.4.0/gems/cgi-0.5.2/lib/cgi/escape.so +0 -0
  74. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/Makefile +4 -4
  75. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_core.c +293 -77
  76. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_parse.c +14 -4
  77. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strptime.c +13 -13
  78. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/extconf.rb +6 -0
  79. data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/lib/date.rb +1 -1
  80. data/vendor/bundle/ruby/3.4.0/gems/date-3.6.0/lib/date_core.so +0 -0
  81. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/avif.rb +1 -0
  82. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/fiber_stream.rb +6 -1
  83. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/heic.rb +1 -0
  84. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/iso_bmff.rb +15 -5
  85. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jxl.rb +1 -0
  86. data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/version.rb +1 -1
  87. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/Gemfile +3 -3
  88. data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/README.md +103 -0
  89. data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/Rakefile +74 -0
  90. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/command_data.rb +13 -10
  91. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_accessors.rb +2 -2
  92. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_type_coercion.rb +14 -26
  93. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config.rb +63 -3
  94. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/esearch_result.rb +2 -2
  95. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/fetch_data.rb +5 -5
  96. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_data.rb +79 -79
  97. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_parser/parser_utils.rb +1 -1
  98. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_parser.rb +2 -1
  99. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/client_adapter.rb +6 -6
  100. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/search_result.rb +4 -6
  101. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sequence_set.rb +413 -52
  102. data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/lib/net/imap/utils.rb +49 -0
  103. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap.rb +195 -46
  104. data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/rdoc.rake +24 -0
  105. data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/lib/net/protocol.rb +38 -23
  106. data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp.rb +5 -8
  107. data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/lib/pstore.rb +52 -31
  108. data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/pstore.gemspec +1 -0
  109. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/CHANGELOG.md +34 -0
  110. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/parser.rb +7 -2
  111. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/uploaded_file.rb +1 -0
  112. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/request.rb +5 -2
  113. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/static.rb +1 -1
  114. data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/version.rb +1 -1
  115. data/vendor/bundle/ruby/3.4.0/specifications/bcrypt-3.1.22.gemspec +33 -0
  116. data/vendor/bundle/ruby/3.4.0/specifications/{date-3.5.1.gemspec → date-3.6.0.gemspec} +3 -3
  117. data/vendor/bundle/ruby/3.4.0/specifications/{fastimage-2.4.1.gemspec → fastimage-2.4.3.gemspec} +3 -3
  118. data/vendor/bundle/ruby/3.4.0/specifications/{net-imap-0.6.6.gemspec → net-imap-0.6.8.gemspec} +3 -3
  119. data/vendor/bundle/ruby/3.4.0/specifications/{net-protocol-0.3.0.gemspec → net-protocol-0.4.0.gemspec} +2 -2
  120. data/vendor/bundle/ruby/3.4.0/specifications/{net-smtp-0.5.1.gemspec → net-smtp-0.5.2.gemspec} +4 -4
  121. data/vendor/bundle/ruby/3.4.0/specifications/{pstore-0.2.1.gemspec → pstore-0.3.0.gemspec} +3 -2
  122. data/vendor/bundle/ruby/3.4.0/specifications/{rack-3.2.7.gemspec → rack-3.2.8.gemspec} +2 -2
  123. data/views/preview.rhtml +2 -1
  124. data/views/preview.rhtml.en +2 -1
  125. data/views/update.rhtml +10 -1
  126. data/views/update.rhtml.en +10 -1
  127. metadata +241 -198
  128. data/vendor/bundle/ruby/3.4.0/cache/date-3.5.1.gem +0 -0
  129. data/vendor/bundle/ruby/3.4.0/cache/fastimage-2.4.1.gem +0 -0
  130. data/vendor/bundle/ruby/3.4.0/cache/net-imap-0.6.6.gem +0 -0
  131. data/vendor/bundle/ruby/3.4.0/cache/net-protocol-0.3.0.gem +0 -0
  132. data/vendor/bundle/ruby/3.4.0/cache/net-smtp-0.5.1.gem +0 -0
  133. data/vendor/bundle/ruby/3.4.0/cache/pstore-0.2.1.gem +0 -0
  134. data/vendor/bundle/ruby/3.4.0/cache/rack-3.2.7.gem +0 -0
  135. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/date_core.so +0 -0
  136. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/gem_make.out +0 -24
  137. data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/mkmf.log +0 -93
  138. data/vendor/bundle/ruby/3.4.0/gems/date-3.5.1/lib/date_core.so +0 -0
  139. data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.6/README.md +0 -77
  140. data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.6/Rakefile +0 -24
  141. /data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/{date-3.5.1 → bcrypt-3.1.22}/gem.build_complete +0 -0
  142. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/BSDL +0 -0
  143. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/COPYING +0 -0
  144. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/README.md +0 -0
  145. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strftime.c +0 -0
  146. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_tmx.h +0 -0
  147. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/prereq.mk +0 -0
  148. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.h +0 -0
  149. /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.list +0 -0
  150. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/MIT-LICENSE +0 -0
  151. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/README.md +0 -0
  152. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage.rb +0 -0
  153. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/bmp.rb +0 -0
  154. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/exif.rb +0 -0
  155. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/gif.rb +0 -0
  156. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/ico.rb +0 -0
  157. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/image_base.rb +0 -0
  158. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jpeg.rb +0 -0
  159. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jxlc.rb +0 -0
  160. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/png.rb +0 -0
  161. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/psd.rb +0 -0
  162. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/stream_util.rb +0 -0
  163. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/svg.rb +0 -0
  164. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/tiff.rb +0 -0
  165. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/type_parser.rb +0 -0
  166. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/webp.rb +0 -0
  167. /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage.rb +0 -0
  168. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/BSDL +0 -0
  169. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/COPYING +0 -0
  170. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/LICENSE.txt +0 -0
  171. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/docs/styles.css +0 -0
  172. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/authenticators.rb +0 -0
  173. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_inheritance.rb +0 -0
  174. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/config/attr_version_defaults.rb +0 -0
  175. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/connection_state.rb +0 -0
  176. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/data_encoding.rb +0 -0
  177. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/deprecated_client_options.rb +0 -0
  178. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/errors.rb +0 -0
  179. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/flags.rb +0 -0
  180. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/response_reader.rb +0 -0
  181. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/anonymous_authenticator.rb +0 -0
  182. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/authentication_exchange.rb +0 -0
  183. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/authenticators.rb +0 -0
  184. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/cram_md5_authenticator.rb +0 -0
  185. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/digest_md5_authenticator.rb +0 -0
  186. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/external_authenticator.rb +0 -0
  187. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/gs2_header.rb +0 -0
  188. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/login_authenticator.rb +0 -0
  189. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/oauthbearer_authenticator.rb +0 -0
  190. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/plain_authenticator.rb +0 -0
  191. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/protocol_adapters.rb +0 -0
  192. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/scram_algorithm.rb +0 -0
  193. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/scram_authenticator.rb +0 -0
  194. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/stringprep.rb +0 -0
  195. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl/xoauth2_authenticator.rb +0 -0
  196. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl.rb +0 -0
  197. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/sasl_adapter.rb +0 -0
  198. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/nameprep.rb +0 -0
  199. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/saslprep.rb +0 -0
  200. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/saslprep_tables.rb +0 -0
  201. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/tables.rb +0 -0
  202. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep/trace.rb +0 -0
  203. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/stringprep.rb +0 -0
  204. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/uidplus_data.rb +0 -0
  205. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap/vanished_data.rb +0 -0
  206. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/net-imap.gemspec +0 -0
  207. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/benchmarks.rake +0 -0
  208. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/rfcs.rake +0 -0
  209. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/saslprep.rake +0 -0
  210. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/string_prep_tables_generator.rb +0 -0
  211. /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/sample/net-imap.rb +0 -0
  212. /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/BSDL +0 -0
  213. /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/COPYING +0 -0
  214. /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/README.md +0 -0
  215. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/LICENSE.txt +0 -0
  216. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/NEWS.md +0 -0
  217. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/README.md +0 -0
  218. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_cram_md5.rb +0 -0
  219. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_login.rb +0 -0
  220. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_plain.rb +0 -0
  221. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/auth_xoauth2.rb +0 -0
  222. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp/authenticator.rb +0 -0
  223. /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/net-smtp.gemspec +0 -0
  224. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/BSDL +0 -0
  225. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/COPYING +0 -0
  226. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/Gemfile +0 -0
  227. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/README.md +0 -0
  228. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/Rakefile +0 -0
  229. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/bin/console +0 -0
  230. /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/bin/setup +0 -0
  231. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/CONTRIBUTING.md +0 -0
  232. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/MIT-LICENSE +0 -0
  233. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/README.md +0 -0
  234. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/SPEC.rdoc +0 -0
  235. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/abstract/handler.rb +0 -0
  236. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/abstract/request.rb +0 -0
  237. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/basic.rb +0 -0
  238. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/bad_request.rb +0 -0
  239. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/body_proxy.rb +0 -0
  240. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/builder.rb +0 -0
  241. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/cascade.rb +0 -0
  242. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/common_logger.rb +0 -0
  243. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/conditional_get.rb +0 -0
  244. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/config.rb +0 -0
  245. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/constants.rb +0 -0
  246. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/content_length.rb +0 -0
  247. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/content_type.rb +0 -0
  248. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/deflater.rb +0 -0
  249. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/directory.rb +0 -0
  250. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/etag.rb +0 -0
  251. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/events.rb +0 -0
  252. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/files.rb +0 -0
  253. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/head.rb +0 -0
  254. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/headers.rb +0 -0
  255. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/lint.rb +0 -0
  256. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/lock.rb +0 -0
  257. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/media_type.rb +0 -0
  258. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/method_override.rb +0 -0
  259. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mime.rb +0 -0
  260. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock.rb +0 -0
  261. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock_request.rb +0 -0
  262. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock_response.rb +0 -0
  263. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/generator.rb +0 -0
  264. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart.rb +0 -0
  265. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/null_logger.rb +0 -0
  266. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/query_parser.rb +0 -0
  267. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/recursive.rb +0 -0
  268. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/reloader.rb +0 -0
  269. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/response.rb +0 -0
  270. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/rewindable_input.rb +0 -0
  271. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/runtime.rb +0 -0
  272. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/sendfile.rb +0 -0
  273. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/show_exceptions.rb +0 -0
  274. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/show_status.rb +0 -0
  275. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/tempfile_reaper.rb +0 -0
  276. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/urlmap.rb +0 -0
  277. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/utils.rb +0 -0
  278. /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack.rb +0 -0
@@ -0,0 +1,203 @@
1
+ /*
2
+ * Written by Solar Designer <solar at openwall.com> in 1998-2010.
3
+ * No copyright is claimed, and the software is hereby placed in the public
4
+ * domain. In case this attempt to disclaim copyright and place the software
5
+ * in the public domain is deemed null and void, then the software is
6
+ * Copyright (c) 1998-2010 Solar Designer and it is hereby released to the
7
+ * general public under the following terms:
8
+ *
9
+ * Redistribution and use in source and binary forms, with or without
10
+ * modification, are permitted.
11
+ *
12
+ * There's ABSOLUTELY NO WARRANTY, express or implied.
13
+ *
14
+ * See crypt_blowfish.c for more information.
15
+ */
16
+
17
+ #ifdef __i386__
18
+
19
+ #if defined(__OpenBSD__) && !defined(__ELF__)
20
+ #define UNDERSCORES
21
+ #define ALIGN_LOG
22
+ #endif
23
+
24
+ #if defined(__CYGWIN32__) || defined(__MINGW32__)
25
+ #define UNDERSCORES
26
+ #endif
27
+
28
+ #ifdef __DJGPP__
29
+ #define UNDERSCORES
30
+ #define ALIGN_LOG
31
+ #endif
32
+
33
+ #ifdef UNDERSCORES
34
+ #define _BF_body_r __BF_body_r
35
+ #endif
36
+
37
+ #ifdef ALIGN_LOG
38
+ #define DO_ALIGN(log) .align (log)
39
+ #elif defined(DUMBAS)
40
+ #define DO_ALIGN(log) .align 1 << log
41
+ #else
42
+ #define DO_ALIGN(log) .align (1 << (log))
43
+ #endif
44
+
45
+ #define BF_FRAME 0x200
46
+ #define ctx %esp
47
+
48
+ #define BF_ptr (ctx)
49
+
50
+ #define S(N, r) N+BF_FRAME(ctx,r,4)
51
+ #ifdef DUMBAS
52
+ #define P(N) 0x1000+N+N+N+N+BF_FRAME(ctx)
53
+ #else
54
+ #define P(N) 0x1000+4*N+BF_FRAME(ctx)
55
+ #endif
56
+
57
+ /*
58
+ * This version of the assembly code is optimized primarily for the original
59
+ * Intel Pentium but is also careful to avoid partial register stalls on the
60
+ * Pentium Pro family of processors (tested up to Pentium III Coppermine).
61
+ *
62
+ * It is possible to do 15% faster on the Pentium Pro family and probably on
63
+ * many non-Intel x86 processors, but, unfortunately, that would make things
64
+ * twice slower for the original Pentium.
65
+ *
66
+ * An additional 2% speedup may be achieved with non-reentrant code.
67
+ */
68
+
69
+ #define L %esi
70
+ #define R %edi
71
+ #define tmp1 %eax
72
+ #define tmp1_lo %al
73
+ #define tmp2 %ecx
74
+ #define tmp2_hi %ch
75
+ #define tmp3 %edx
76
+ #define tmp3_lo %dl
77
+ #define tmp4 %ebx
78
+ #define tmp4_hi %bh
79
+ #define tmp5 %ebp
80
+
81
+ .text
82
+
83
+ #define BF_ROUND(L, R, N) \
84
+ xorl L,tmp2; \
85
+ xorl tmp1,tmp1; \
86
+ movl tmp2,L; \
87
+ shrl $16,tmp2; \
88
+ movl L,tmp4; \
89
+ movb tmp2_hi,tmp1_lo; \
90
+ andl $0xFF,tmp2; \
91
+ movb tmp4_hi,tmp3_lo; \
92
+ andl $0xFF,tmp4; \
93
+ movl S(0,tmp1),tmp1; \
94
+ movl S(0x400,tmp2),tmp5; \
95
+ addl tmp5,tmp1; \
96
+ movl S(0x800,tmp3),tmp5; \
97
+ xorl tmp5,tmp1; \
98
+ movl S(0xC00,tmp4),tmp5; \
99
+ addl tmp1,tmp5; \
100
+ movl 4+P(N),tmp2; \
101
+ xorl tmp5,R
102
+
103
+ #define BF_ENCRYPT_START \
104
+ BF_ROUND(L, R, 0); \
105
+ BF_ROUND(R, L, 1); \
106
+ BF_ROUND(L, R, 2); \
107
+ BF_ROUND(R, L, 3); \
108
+ BF_ROUND(L, R, 4); \
109
+ BF_ROUND(R, L, 5); \
110
+ BF_ROUND(L, R, 6); \
111
+ BF_ROUND(R, L, 7); \
112
+ BF_ROUND(L, R, 8); \
113
+ BF_ROUND(R, L, 9); \
114
+ BF_ROUND(L, R, 10); \
115
+ BF_ROUND(R, L, 11); \
116
+ BF_ROUND(L, R, 12); \
117
+ BF_ROUND(R, L, 13); \
118
+ BF_ROUND(L, R, 14); \
119
+ BF_ROUND(R, L, 15); \
120
+ movl BF_ptr,tmp5; \
121
+ xorl L,tmp2; \
122
+ movl P(17),L
123
+
124
+ #define BF_ENCRYPT_END \
125
+ xorl R,L; \
126
+ movl tmp2,R
127
+
128
+ DO_ALIGN(5)
129
+ .globl _BF_body_r
130
+ _BF_body_r:
131
+ movl 4(%esp),%eax
132
+ pushl %ebp
133
+ pushl %ebx
134
+ pushl %esi
135
+ pushl %edi
136
+ subl $BF_FRAME-8,%eax
137
+ xorl L,L
138
+ cmpl %esp,%eax
139
+ ja BF_die
140
+ xchgl %eax,%esp
141
+ xorl R,R
142
+ pushl %eax
143
+ leal 0x1000+BF_FRAME-4(ctx),%eax
144
+ movl 0x1000+BF_FRAME-4(ctx),tmp2
145
+ pushl %eax
146
+ xorl tmp3,tmp3
147
+ BF_loop_P:
148
+ BF_ENCRYPT_START
149
+ addl $8,tmp5
150
+ BF_ENCRYPT_END
151
+ leal 0x1000+18*4+BF_FRAME(ctx),tmp1
152
+ movl tmp5,BF_ptr
153
+ cmpl tmp5,tmp1
154
+ movl L,-8(tmp5)
155
+ movl R,-4(tmp5)
156
+ movl P(0),tmp2
157
+ ja BF_loop_P
158
+ leal BF_FRAME(ctx),tmp5
159
+ xorl tmp3,tmp3
160
+ movl tmp5,BF_ptr
161
+ BF_loop_S:
162
+ BF_ENCRYPT_START
163
+ BF_ENCRYPT_END
164
+ movl P(0),tmp2
165
+ movl L,(tmp5)
166
+ movl R,4(tmp5)
167
+ BF_ENCRYPT_START
168
+ BF_ENCRYPT_END
169
+ movl P(0),tmp2
170
+ movl L,8(tmp5)
171
+ movl R,12(tmp5)
172
+ BF_ENCRYPT_START
173
+ BF_ENCRYPT_END
174
+ movl P(0),tmp2
175
+ movl L,16(tmp5)
176
+ movl R,20(tmp5)
177
+ BF_ENCRYPT_START
178
+ addl $32,tmp5
179
+ BF_ENCRYPT_END
180
+ leal 0x1000+BF_FRAME(ctx),tmp1
181
+ movl tmp5,BF_ptr
182
+ cmpl tmp5,tmp1
183
+ movl P(0),tmp2
184
+ movl L,-8(tmp5)
185
+ movl R,-4(tmp5)
186
+ ja BF_loop_S
187
+ movl 4(%esp),%esp
188
+ popl %edi
189
+ popl %esi
190
+ popl %ebx
191
+ popl %ebp
192
+ ret
193
+
194
+ BF_die:
195
+ /* Oops, need to re-compile with a larger BF_FRAME. */
196
+ hlt
197
+ jmp BF_die
198
+
199
+ #endif
200
+
201
+ #if defined(__ELF__) && defined(__linux__)
202
+ .section .note.GNU-stack,"",%progbits
203
+ #endif
@@ -0,0 +1,134 @@
1
+ module BCrypt
2
+ # A Ruby wrapper for the bcrypt() C extension calls and the Java calls.
3
+ class Engine
4
+ # The default computational expense parameter.
5
+ DEFAULT_COST = 12
6
+ # The minimum cost supported by the algorithm.
7
+ MIN_COST = 4
8
+ # The maximum cost supported by the algorithm.
9
+ MAX_COST = 31
10
+ # Maximum possible size of bcrypt() secrets.
11
+ # Older versions of the bcrypt library would truncate passwords longer
12
+ # than 72 bytes, but newer ones do not. We truncate like the old library for
13
+ # forward compatibility. This way users upgrading from Ubuntu 18.04 to 20.04
14
+ # will not have their user passwords invalidated, for example.
15
+ # A max secret length greater than 255 leads to bcrypt returning nil.
16
+ # https://github.com/bcrypt-ruby/bcrypt-ruby/issues/225#issuecomment-875908425
17
+ MAX_SECRET_BYTESIZE = 72
18
+ # Maximum possible size of bcrypt() salts.
19
+ MAX_SALT_LENGTH = 16
20
+
21
+ if RUBY_PLATFORM != "java"
22
+ # C-level routines which, if they don't get the right input, will crash the
23
+ # hell out of the Ruby process.
24
+ private_class_method :__bc_salt
25
+ private_class_method :__bc_crypt
26
+ end
27
+
28
+ @cost = nil
29
+
30
+ # Returns the cost factor that will be used if one is not specified when
31
+ # creating a password hash. Defaults to DEFAULT_COST if not set.
32
+ def self.cost
33
+ @cost || DEFAULT_COST
34
+ end
35
+
36
+ # Set a default cost factor that will be used if one is not specified when
37
+ # creating a password hash.
38
+ #
39
+ # Example:
40
+ #
41
+ # BCrypt::Engine::DEFAULT_COST #=> 12
42
+ # BCrypt::Password.create('secret').cost #=> 12
43
+ #
44
+ # BCrypt::Engine.cost = 8
45
+ # BCrypt::Password.create('secret').cost #=> 8
46
+ #
47
+ # # cost can still be overridden as needed
48
+ # BCrypt::Password.create('secret', :cost => 6).cost #=> 6
49
+ def self.cost=(cost)
50
+ @cost = cost
51
+ end
52
+
53
+ # Given a secret and a valid salt (see BCrypt::Engine.generate_salt) calculates
54
+ # a bcrypt() password hash. Secrets longer than 72 bytes are truncated.
55
+ def self.hash_secret(secret, salt, _ = nil)
56
+ unless _.nil?
57
+ warn "[DEPRECATION] Passing the third argument to " \
58
+ "`BCrypt::Engine.hash_secret` is deprecated. " \
59
+ "Please do not pass the third argument which " \
60
+ "is currently not used."
61
+ end
62
+
63
+ if valid_secret?(secret)
64
+ if valid_salt?(salt)
65
+ if RUBY_PLATFORM == "java"
66
+ Java.bcrypt_jruby.BCrypt.hashpw(secret.to_s.to_java_bytes, salt.to_s)
67
+ else
68
+ secret = secret.to_s
69
+ secret = secret.byteslice(0, MAX_SECRET_BYTESIZE) if secret && secret.bytesize > MAX_SECRET_BYTESIZE
70
+ __bc_crypt(secret, salt)
71
+ end
72
+ else
73
+ raise Errors::InvalidSalt.new("invalid salt")
74
+ end
75
+ else
76
+ raise Errors::InvalidSecret.new("invalid secret")
77
+ end
78
+ end
79
+
80
+ # Generates a random salt with a given computational cost.
81
+ def self.generate_salt(cost = self.cost)
82
+ cost = cost.to_i
83
+ if cost > 0
84
+ if cost < MIN_COST
85
+ cost = MIN_COST
86
+ end
87
+ if RUBY_PLATFORM == "java"
88
+ Java.bcrypt_jruby.BCrypt.gensalt(cost)
89
+ else
90
+ __bc_salt("$2a$", cost, OpenSSL::Random.random_bytes(MAX_SALT_LENGTH))
91
+ end
92
+ else
93
+ raise Errors::InvalidCost.new("cost must be numeric and > 0")
94
+ end
95
+ end
96
+
97
+ # Returns true if +salt+ is a valid bcrypt() salt, false if not.
98
+ def self.valid_salt?(salt)
99
+ !!(salt =~ /\A\$[0-9a-z]{2,}\$[0-9]{2,}\$[A-Za-z0-9\.\/]{22,}\z/)
100
+ end
101
+
102
+ # Returns true if +secret+ is a valid bcrypt() secret, false if not.
103
+ def self.valid_secret?(secret)
104
+ secret.respond_to?(:to_s)
105
+ end
106
+
107
+ # Returns the cost factor which will result in computation times less than +upper_time_limit_in_ms+.
108
+ #
109
+ # Example:
110
+ #
111
+ # BCrypt::Engine.calibrate(200) #=> 10
112
+ # BCrypt::Engine.calibrate(1000) #=> 12
113
+ #
114
+ # # should take less than 200ms
115
+ # BCrypt::Password.create("woo", :cost => 10)
116
+ #
117
+ # # should take less than 1000ms
118
+ # BCrypt::Password.create("woo", :cost => 12)
119
+ def self.calibrate(upper_time_limit_in_ms)
120
+ (BCrypt::Engine::MIN_COST..BCrypt::Engine::MAX_COST-1).each do |i|
121
+ start_time = Time.now
122
+ Password.create("testing testing", :cost => i+1)
123
+ end_time = Time.now - start_time
124
+ return i if end_time * 1_000 > upper_time_limit_in_ms
125
+ end
126
+ end
127
+
128
+ # Autodetects the cost from the salt string.
129
+ def self.autodetect_cost(salt)
130
+ salt[4..5].to_i
131
+ end
132
+ end
133
+
134
+ end
@@ -0,0 +1,22 @@
1
+ module BCrypt
2
+
3
+ class Error < StandardError # :nodoc:
4
+ end
5
+
6
+ module Errors # :nodoc:
7
+
8
+ # The salt parameter provided to bcrypt() is invalid.
9
+ class InvalidSalt < BCrypt::Error; end
10
+
11
+ # The hash parameter provided to bcrypt() is invalid.
12
+ class InvalidHash < BCrypt::Error; end
13
+
14
+ # The cost parameter provided to bcrypt() is invalid.
15
+ class InvalidCost < BCrypt::Error; end
16
+
17
+ # The secret parameter provided to bcrypt() is invalid.
18
+ class InvalidSecret < BCrypt::Error; end
19
+
20
+ end
21
+
22
+ end
@@ -0,0 +1,106 @@
1
+ module BCrypt
2
+ # A password management class which allows you to safely store users' passwords and compare them.
3
+ #
4
+ # Example usage:
5
+ #
6
+ # include BCrypt
7
+ #
8
+ # # hash a user's password
9
+ # @password = Password.create("my grand secret")
10
+ # @password #=> "$2a$12$C5.FIvVDS9W4AYZ/Ib37YuWd/7ozp1UaMhU28UKrfSxp2oDchbi3K"
11
+ #
12
+ # # store it safely
13
+ # @user.update_attribute(:password, @password)
14
+ #
15
+ # # read it back
16
+ # @user.reload!
17
+ # @db_password = Password.new(@user.password)
18
+ #
19
+ # # compare it after retrieval
20
+ # @db_password == "my grand secret" #=> true
21
+ # @db_password == "a paltry guess" #=> false
22
+ #
23
+ class Password < String
24
+ # The hash portion of the stored password hash.
25
+ attr_reader :checksum
26
+ # The salt of the store password hash (including version and cost).
27
+ attr_reader :salt
28
+ # The version of the bcrypt() algorithm used to create the hash.
29
+ attr_reader :version
30
+ # The cost factor used to create the hash.
31
+ attr_reader :cost
32
+
33
+ class << self
34
+ # Hashes a secret, returning a BCrypt::Password instance. Takes an optional <tt>:cost</tt> option, which is a
35
+ # logarithmic variable which determines how computational expensive the hash is to calculate (a <tt>:cost</tt> of
36
+ # 4 is twice as much work as a <tt>:cost</tt> of 3). The higher the <tt>:cost</tt> the harder it becomes for
37
+ # attackers to try to guess passwords (even if a copy of your database is stolen), but the slower it is to check
38
+ # users' passwords.
39
+ #
40
+ # Example:
41
+ #
42
+ # @password = BCrypt::Password.create("my secret", :cost => 13)
43
+ def create(secret, options = {})
44
+ cost = options[:cost] || BCrypt::Engine.cost
45
+ raise ArgumentError if cost > BCrypt::Engine::MAX_COST
46
+ Password.new(BCrypt::Engine.hash_secret(secret, BCrypt::Engine.generate_salt(cost)))
47
+ end
48
+
49
+ def valid_hash?(h)
50
+ /\A\$[0-9a-z]{2}\$[0-9]{2}\$[A-Za-z0-9\.\/]{53}\z/ === h
51
+ end
52
+ end
53
+
54
+ # Initializes a BCrypt::Password instance with the data from a stored hash.
55
+ def initialize(raw_hash)
56
+ if valid_hash?(raw_hash)
57
+ self.replace(raw_hash)
58
+ @version, @cost, @salt, @checksum = split_hash(self)
59
+ else
60
+ raise Errors::InvalidHash.new("invalid hash")
61
+ end
62
+ end
63
+
64
+ # Compares a potential secret against the hash. Returns true if the secret is the original secret, false otherwise.
65
+ #
66
+ # Comparison edge case/gotcha:
67
+ #
68
+ # secret = "my secret"
69
+ # @password = BCrypt::Password.create(secret)
70
+ #
71
+ # @password == secret # => True
72
+ # @password == @password # => False
73
+ # @password == @password.to_s # => False
74
+ # @password.to_s == @password # => True
75
+ # @password.to_s == @password.to_s # => True
76
+ #
77
+ # secret == @password # => probably False, because the secret is not a BCrypt::Password instance.
78
+ def ==(secret)
79
+ hash = BCrypt::Engine.hash_secret(secret, @salt)
80
+
81
+ return false if hash.strip.empty? || strip.empty? || hash.bytesize != bytesize
82
+
83
+ # Constant time comparison so they can't tell the length.
84
+ res = 0
85
+ bytesize.times { |i| res |= getbyte(i) ^ hash.getbyte(i) }
86
+ res == 0
87
+ end
88
+ alias_method :is_password?, :==
89
+
90
+ private
91
+
92
+ # Returns true if +h+ is a valid hash.
93
+ def valid_hash?(h)
94
+ self.class.valid_hash?(h)
95
+ end
96
+
97
+ # call-seq:
98
+ # split_hash(raw_hash) -> version, cost, salt, hash
99
+ #
100
+ # Splits +h+ into version, cost, salt, and hash and returns them in that order.
101
+ def split_hash(h)
102
+ _, v, c, mash = h.split('$')
103
+ return v.to_str, c.to_i, h[0, 29].to_str, mash[-31, 31].to_str
104
+ end
105
+ end
106
+ end
@@ -0,0 +1,16 @@
1
+ # A Ruby library implementing OpenBSD's bcrypt()/crypt_blowfish algorithm for
2
+ # hashing passwords.
3
+ module BCrypt
4
+ end
5
+
6
+ if RUBY_PLATFORM == "java"
7
+ require 'java'
8
+ else
9
+ require "openssl"
10
+ end
11
+
12
+ require "bcrypt_ext"
13
+
14
+ require 'bcrypt/error'
15
+ require 'bcrypt/engine'
16
+ require 'bcrypt/password'
@@ -13,12 +13,12 @@ NULLCMD = :
13
13
  #### Start of system configuration section. ####
14
14
 
15
15
  srcdir = .
16
- topdir = /opt/hostedtoolcache/Ruby/3.4.11/x64/include/ruby-3.4.0
16
+ topdir = /opt/hostedtoolcache/Ruby/3.4.13/x64/include/ruby-3.4.0
17
17
  hdrdir = $(topdir)
18
- arch_hdrdir = /opt/hostedtoolcache/Ruby/3.4.11/x64/include/ruby-3.4.0/x86_64-linux
18
+ arch_hdrdir = /opt/hostedtoolcache/Ruby/3.4.13/x64/include/ruby-3.4.0/x86_64-linux
19
19
  PATH_SEPARATOR = :
20
20
  VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
21
- prefix = $(DESTDIR)/opt/hostedtoolcache/Ruby/3.4.11/x64
21
+ prefix = $(DESTDIR)/opt/hostedtoolcache/Ruby/3.4.13/x64
22
22
  rubysitearchprefix = $(rubylibprefix)/$(sitearch)
23
23
  rubyarchprefix = $(rubylibprefix)/$(arch)
24
24
  rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
@@ -13,12 +13,12 @@ NULLCMD = :
13
13
  #### Start of system configuration section. ####
14
14
 
15
15
  srcdir = .
16
- topdir = /opt/hostedtoolcache/Ruby/3.4.11/x64/include/ruby-3.4.0
16
+ topdir = /opt/hostedtoolcache/Ruby/3.4.13/x64/include/ruby-3.4.0
17
17
  hdrdir = $(topdir)
18
- arch_hdrdir = /opt/hostedtoolcache/Ruby/3.4.11/x64/include/ruby-3.4.0/x86_64-linux
18
+ arch_hdrdir = /opt/hostedtoolcache/Ruby/3.4.13/x64/include/ruby-3.4.0/x86_64-linux
19
19
  PATH_SEPARATOR = :
20
20
  VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
21
- prefix = $(DESTDIR)/opt/hostedtoolcache/Ruby/3.4.11/x64
21
+ prefix = $(DESTDIR)/opt/hostedtoolcache/Ruby/3.4.13/x64
22
22
  rubysitearchprefix = $(rubylibprefix)/$(sitearch)
23
23
  rubyarchprefix = $(rubylibprefix)/$(arch)
24
24
  rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
@@ -89,7 +89,7 @@ CCDLFLAGS = -fPIC
89
89
  CFLAGS = $(CCDLFLAGS) $(cflags) -fPIC $(ARCH_FLAG)
90
90
  INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
91
91
  DEFS =
92
- CPPFLAGS = -DHAVE_RB_CATEGORY_WARN -DHAVE_TIMEZONE -DENABLE_PATH_CHECK=0 $(DEFS) $(cppflags)
92
+ CPPFLAGS = -DHAVE_RB_CATEGORY_WARN -DHAVE_TIMEZONE -DHAVE_RB_GC_MARK_MOVABLE -DHAVE_CONST_RUBY_TYPED_EMBEDDABLE -DENABLE_PATH_CHECK=0 $(DEFS) $(cppflags)
93
93
  CXXFLAGS = $(CCDLFLAGS) $(ARCH_FLAG)
94
94
  ldflags = -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed
95
95
  dldflags = -Wl,--compress-debug-sections=zlib