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.
- checksums.yaml +4 -4
- data/Gemfile +7 -0
- data/Gemfile.lock +60 -57
- data/doc/HOWTO-authenticate-in-rack.md +3 -3
- data/js/00default.js +22 -12
- data/js/caretposition.js +1 -0
- data/js/draft.js +82 -5
- data/js/image.js +2 -4
- data/js/preview.js +12 -50
- data/js/update.js +54 -0
- data/js/update_preview.js +79 -0
- data/lib/aws/pa_api.rb +7 -7
- data/lib/tdiary/admin.rb +66 -3
- data/lib/tdiary/cli.rb +14 -10
- data/lib/tdiary/core_ext.rb +46 -8
- data/lib/tdiary/dispatcher/update_main.rb +6 -0
- data/lib/tdiary/io/plugin_pstore.rb +2 -1
- data/lib/tdiary/plugin/00default.rb +3 -0
- data/lib/tdiary/rack/auth/basic.rb +72 -9
- data/lib/tdiary/tasks/auth.rake +2 -4
- data/lib/tdiary/tasks/release.rake +5 -4
- data/lib/tdiary/version.rb +1 -1
- data/lib/tdiary.rb +3 -0
- data/misc/plugin/amazon.rb +19 -8
- data/misc/plugin/amazon_rakuten.rb +10 -6
- data/misc/plugin/draft.rb +11 -3
- data/misc/plugin/en/preview.rb +0 -2
- data/misc/plugin/image.rb +6 -11
- data/misc/plugin/ja/preview.rb +0 -2
- data/misc/plugin/makerss.rb +2 -2
- data/misc/plugin/my-sequel.rb +1 -0
- data/misc/plugin/preview.rb +0 -8
- data/theme/base.css +32 -2
- data/theme/conf.css +60 -0
- data/vendor/bundle/ruby/3.4.0/cache/bcrypt-3.1.22.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/date-3.6.0.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/fastimage-2.4.3.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-imap-0.6.8.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-protocol-0.4.0.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-smtp-0.5.2.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/pstore-0.3.0.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/rack-3.2.8.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bcrypt-3.1.22/bcrypt_ext.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/bcrypt-3.1.22/gem_make.out +28 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/cgi-0.5.2/cgi/escape.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/cgi-0.5.2/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/date_core.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/gem.build_complete +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/gem_make.out +26 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.6.0/mkmf.log +140 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/CHANGELOG +127 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/COPYING +28 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/README.md +192 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/jruby/bcrypt_jruby/BCrypt.java +926 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/Makefile +273 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/bcrypt_ext.c +125 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt.c +57 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt.h +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_blowfish.c +903 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_blowfish.h +27 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_gensalt.c +124 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/crypt_gensalt.h +30 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/extconf.rb +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/ow-crypt.h +43 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/wrapper.c +554 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/ext/mri/x86.S +203 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/engine.rb +134 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/error.rb +22 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt/password.rb +106 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt.rb +16 -0
- data/vendor/bundle/ruby/3.4.0/gems/bcrypt-3.1.22/lib/bcrypt_ext.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/cgi-0.5.2/ext/cgi/escape/Makefile +3 -3
- data/vendor/bundle/ruby/3.4.0/gems/cgi-0.5.2/lib/cgi/escape.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/Makefile +4 -4
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_core.c +293 -77
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_parse.c +14 -4
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strptime.c +13 -13
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/extconf.rb +6 -0
- data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/lib/date.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/date-3.6.0/lib/date_core.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/avif.rb +1 -0
- 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
- data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/heic.rb +1 -0
- 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
- data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jxl.rb +1 -0
- data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/version.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/Gemfile +3 -3
- data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/README.md +103 -0
- data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/Rakefile +74 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.8/lib/net/imap/utils.rb +49 -0
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/lib/net/imap.rb +195 -46
- data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/rdoc.rake +24 -0
- data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/lib/net/protocol.rb +38 -23
- data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/lib/net/smtp.rb +5 -8
- data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/lib/pstore.rb +52 -31
- data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/pstore.gemspec +1 -0
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/CHANGELOG.md +34 -0
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/parser.rb +7 -2
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/uploaded_file.rb +1 -0
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/request.rb +5 -2
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/static.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/version.rb +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/bcrypt-3.1.22.gemspec +33 -0
- data/vendor/bundle/ruby/3.4.0/specifications/{date-3.5.1.gemspec → date-3.6.0.gemspec} +3 -3
- data/vendor/bundle/ruby/3.4.0/specifications/{fastimage-2.4.1.gemspec → fastimage-2.4.3.gemspec} +3 -3
- data/vendor/bundle/ruby/3.4.0/specifications/{net-imap-0.6.6.gemspec → net-imap-0.6.8.gemspec} +3 -3
- data/vendor/bundle/ruby/3.4.0/specifications/{net-protocol-0.3.0.gemspec → net-protocol-0.4.0.gemspec} +2 -2
- data/vendor/bundle/ruby/3.4.0/specifications/{net-smtp-0.5.1.gemspec → net-smtp-0.5.2.gemspec} +4 -4
- data/vendor/bundle/ruby/3.4.0/specifications/{pstore-0.2.1.gemspec → pstore-0.3.0.gemspec} +3 -2
- data/vendor/bundle/ruby/3.4.0/specifications/{rack-3.2.7.gemspec → rack-3.2.8.gemspec} +2 -2
- data/views/preview.rhtml +2 -1
- data/views/preview.rhtml.en +2 -1
- data/views/update.rhtml +10 -1
- data/views/update.rhtml.en +10 -1
- metadata +241 -198
- data/vendor/bundle/ruby/3.4.0/cache/date-3.5.1.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/fastimage-2.4.1.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-imap-0.6.6.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-protocol-0.3.0.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/net-smtp-0.5.1.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/pstore-0.2.1.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/cache/rack-3.2.7.gem +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/date_core.so +0 -0
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/gem_make.out +0 -24
- data/vendor/bundle/ruby/3.4.0/extensions/x86_64-linux/3.4.0/date-3.5.1/mkmf.log +0 -93
- data/vendor/bundle/ruby/3.4.0/gems/date-3.5.1/lib/date_core.so +0 -0
- data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.6/README.md +0 -77
- data/vendor/bundle/ruby/3.4.0/gems/net-imap-0.6.6/Rakefile +0 -24
- /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
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_strftime.c +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/date_tmx.h +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/prereq.mk +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.h +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{date-3.5.1 → date-3.6.0}/ext/date/zonetab.list +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/bmp.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/exif.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/gif.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/ico.rb +0 -0
- /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
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jpeg.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/jxlc.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/png.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/psd.rb +0 -0
- /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
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/svg.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/tiff.rb +0 -0
- /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
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage/fastimage_parsing/webp.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{fastimage-2.4.1 → fastimage-2.4.3}/lib/fastimage.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/docs/styles.css +0 -0
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /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
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/net-imap.gemspec +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/benchmarks.rake +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/rfcs.rake +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/rakelib/saslprep.rake +0 -0
- /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
- /data/vendor/bundle/ruby/3.4.0/gems/{net-imap-0.6.6 → net-imap-0.6.8}/sample/net-imap.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-protocol-0.3.0 → net-protocol-0.4.0}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/NEWS.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/README.md +0 -0
- /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
- /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
- /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
- /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
- /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
- /data/vendor/bundle/ruby/3.4.0/gems/{net-smtp-0.5.1 → net-smtp-0.5.2}/net-smtp.gemspec +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/Gemfile +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/Rakefile +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/bin/console +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{pstore-0.2.1 → pstore-0.3.0}/bin/setup +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/CONTRIBUTING.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/SPEC.rdoc +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/abstract/handler.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/abstract/request.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/auth/basic.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/bad_request.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/body_proxy.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/builder.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/cascade.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/common_logger.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/conditional_get.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/config.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/constants.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/content_length.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/content_type.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/deflater.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/directory.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/etag.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/events.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/files.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/head.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/headers.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/lint.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/lock.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/media_type.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/method_override.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mime.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock_request.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/mock_response.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart/generator.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/multipart.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/null_logger.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/query_parser.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/recursive.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/reloader.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/response.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/rewindable_input.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/runtime.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/sendfile.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/show_exceptions.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/show_status.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/tempfile_reaper.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/urlmap.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack/utils.rb +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.2.7 → rack-3.2.8}/lib/rack.rb +0 -0
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Written by Solar Designer <solar at openwall.com> in 2000-2014.
|
|
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) 2000-2014 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
|
+
#include <stdlib.h>
|
|
18
|
+
#include <string.h>
|
|
19
|
+
|
|
20
|
+
/* Redefine strdup to ruby_strdup in case string.h doesn't export it. */
|
|
21
|
+
#include <ruby/util.h>
|
|
22
|
+
|
|
23
|
+
#include <errno.h>
|
|
24
|
+
#ifndef __set_errno
|
|
25
|
+
#define __set_errno(val) errno = (val)
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#ifdef TEST
|
|
29
|
+
#include <stdio.h>
|
|
30
|
+
#include <unistd.h>
|
|
31
|
+
#include <signal.h>
|
|
32
|
+
#include <time.h>
|
|
33
|
+
#include <sys/time.h>
|
|
34
|
+
#include <sys/times.h>
|
|
35
|
+
#ifdef TEST_THREADS
|
|
36
|
+
#include <pthread.h>
|
|
37
|
+
#endif
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
#define CRYPT_OUTPUT_SIZE (7 + 22 + 31 + 1)
|
|
41
|
+
#define CRYPT_GENSALT_OUTPUT_SIZE (7 + 22 + 1)
|
|
42
|
+
|
|
43
|
+
#if defined(__GLIBC__) && defined(_LIBC)
|
|
44
|
+
#define __SKIP_GNU
|
|
45
|
+
#endif
|
|
46
|
+
#include "ow-crypt.h"
|
|
47
|
+
|
|
48
|
+
#include "crypt_blowfish.h"
|
|
49
|
+
#include "crypt_gensalt.h"
|
|
50
|
+
|
|
51
|
+
#if defined(__GLIBC__) && defined(_LIBC)
|
|
52
|
+
/* crypt.h from glibc-crypt-2.1 will define struct crypt_data for us */
|
|
53
|
+
#include "crypt.h"
|
|
54
|
+
extern char *__md5_crypt_r(const char *key, const char *salt,
|
|
55
|
+
char *buffer, int buflen);
|
|
56
|
+
/* crypt-entry.c needs to be patched to define __des_crypt_r rather than
|
|
57
|
+
* __crypt_r, and not define crypt_r and crypt at all */
|
|
58
|
+
extern char *__des_crypt_r(const char *key, const char *salt,
|
|
59
|
+
struct crypt_data *data);
|
|
60
|
+
extern struct crypt_data _ufc_foobar;
|
|
61
|
+
#endif
|
|
62
|
+
|
|
63
|
+
static int _crypt_data_alloc(void **data, int *size, int need)
|
|
64
|
+
{
|
|
65
|
+
void *updated;
|
|
66
|
+
|
|
67
|
+
if (*data && *size >= need) return 0;
|
|
68
|
+
|
|
69
|
+
updated = realloc(*data, need);
|
|
70
|
+
|
|
71
|
+
if (!updated) {
|
|
72
|
+
#ifndef __GLIBC__
|
|
73
|
+
/* realloc(3) on glibc sets errno, so we don't need to bother */
|
|
74
|
+
__set_errno(ENOMEM);
|
|
75
|
+
#endif
|
|
76
|
+
return -1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#if defined(__GLIBC__) && defined(_LIBC)
|
|
80
|
+
if (need >= sizeof(struct crypt_data))
|
|
81
|
+
((struct crypt_data *)updated)->initialized = 0;
|
|
82
|
+
#endif
|
|
83
|
+
|
|
84
|
+
*data = updated;
|
|
85
|
+
*size = need;
|
|
86
|
+
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
static char *_crypt_retval_magic(char *retval, const char *setting,
|
|
91
|
+
char *output, int size)
|
|
92
|
+
{
|
|
93
|
+
if (retval)
|
|
94
|
+
return retval;
|
|
95
|
+
|
|
96
|
+
if (_crypt_output_magic(setting, output, size))
|
|
97
|
+
return NULL; /* shouldn't happen */
|
|
98
|
+
|
|
99
|
+
return output;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
#if defined(__GLIBC__) && defined(_LIBC)
|
|
103
|
+
/*
|
|
104
|
+
* Applications may re-use the same instance of struct crypt_data without
|
|
105
|
+
* resetting the initialized field in order to let crypt_r() skip some of
|
|
106
|
+
* its initialization code. Thus, it is important that our multiple hashing
|
|
107
|
+
* algorithms either don't conflict with each other in their use of the
|
|
108
|
+
* data area or reset the initialized field themselves whenever required.
|
|
109
|
+
* Currently, the hashing algorithms simply have no conflicts: the first
|
|
110
|
+
* field of struct crypt_data is the 128-byte large DES key schedule which
|
|
111
|
+
* __des_crypt_r() calculates each time it is called while the two other
|
|
112
|
+
* hashing algorithms use less than 128 bytes of the data area.
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
char *__crypt_rn(__const char *key, __const char *setting,
|
|
116
|
+
void *data, int size)
|
|
117
|
+
{
|
|
118
|
+
if (setting[0] == '$' && setting[1] == '2')
|
|
119
|
+
return _crypt_blowfish_rn(key, setting, (char *)data, size);
|
|
120
|
+
if (setting[0] == '$' && setting[1] == '1')
|
|
121
|
+
return __md5_crypt_r(key, setting, (char *)data, size);
|
|
122
|
+
if (setting[0] == '$' || setting[0] == '_') {
|
|
123
|
+
__set_errno(EINVAL);
|
|
124
|
+
return NULL;
|
|
125
|
+
}
|
|
126
|
+
if (size >= sizeof(struct crypt_data))
|
|
127
|
+
return __des_crypt_r(key, setting, (struct crypt_data *)data);
|
|
128
|
+
__set_errno(ERANGE);
|
|
129
|
+
return NULL;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
char *__crypt_ra(__const char *key, __const char *setting,
|
|
133
|
+
void **data, int *size)
|
|
134
|
+
{
|
|
135
|
+
if (setting[0] == '$' && setting[1] == '2') {
|
|
136
|
+
if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
|
|
137
|
+
return NULL;
|
|
138
|
+
return _crypt_blowfish_rn(key, setting, (char *)*data, *size);
|
|
139
|
+
}
|
|
140
|
+
if (setting[0] == '$' && setting[1] == '1') {
|
|
141
|
+
if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
|
|
142
|
+
return NULL;
|
|
143
|
+
return __md5_crypt_r(key, setting, (char *)*data, *size);
|
|
144
|
+
}
|
|
145
|
+
if (setting[0] == '$' || setting[0] == '_') {
|
|
146
|
+
__set_errno(EINVAL);
|
|
147
|
+
return NULL;
|
|
148
|
+
}
|
|
149
|
+
if (_crypt_data_alloc(data, size, sizeof(struct crypt_data)))
|
|
150
|
+
return NULL;
|
|
151
|
+
return __des_crypt_r(key, setting, (struct crypt_data *)*data);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
char *__crypt_r(__const char *key, __const char *setting,
|
|
155
|
+
struct crypt_data *data)
|
|
156
|
+
{
|
|
157
|
+
return _crypt_retval_magic(
|
|
158
|
+
__crypt_rn(key, setting, data, sizeof(*data)),
|
|
159
|
+
setting, (char *)data, sizeof(*data));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
char *__crypt(__const char *key, __const char *setting)
|
|
163
|
+
{
|
|
164
|
+
return _crypt_retval_magic(
|
|
165
|
+
__crypt_rn(key, setting, &_ufc_foobar, sizeof(_ufc_foobar)),
|
|
166
|
+
setting, (char *)&_ufc_foobar, sizeof(_ufc_foobar));
|
|
167
|
+
}
|
|
168
|
+
#else
|
|
169
|
+
char *crypt_rn(const char *key, const char *setting, void *data, int size)
|
|
170
|
+
{
|
|
171
|
+
return _crypt_blowfish_rn(key, setting, (char *)data, size);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
char *crypt_ra(const char *key, const char *setting,
|
|
175
|
+
void **data, int *size)
|
|
176
|
+
{
|
|
177
|
+
if (_crypt_data_alloc(data, size, CRYPT_OUTPUT_SIZE))
|
|
178
|
+
return NULL;
|
|
179
|
+
return _crypt_blowfish_rn(key, setting, (char *)*data, *size);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
char *crypt_r(const char *key, const char *setting, struct crypt_data *data)
|
|
183
|
+
{
|
|
184
|
+
return _crypt_retval_magic(
|
|
185
|
+
crypt_rn(key, setting, data, CRYPT_OUTPUT_SIZE),
|
|
186
|
+
setting, (char *)data, CRYPT_OUTPUT_SIZE);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
char *crypt(const char *key, const char *setting)
|
|
190
|
+
{
|
|
191
|
+
static char output[CRYPT_OUTPUT_SIZE];
|
|
192
|
+
|
|
193
|
+
return _crypt_retval_magic(
|
|
194
|
+
crypt_rn(key, setting, output, sizeof(output)),
|
|
195
|
+
setting, output, sizeof(output));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
#define __crypt_gensalt_rn crypt_gensalt_rn
|
|
199
|
+
#define __crypt_gensalt_ra crypt_gensalt_ra
|
|
200
|
+
#define __crypt_gensalt crypt_gensalt
|
|
201
|
+
#endif
|
|
202
|
+
|
|
203
|
+
char *__crypt_gensalt_rn(const char *prefix, unsigned long count,
|
|
204
|
+
const char *input, int size, char *output, int output_size)
|
|
205
|
+
{
|
|
206
|
+
char *(*use)(const char *_prefix, unsigned long _count,
|
|
207
|
+
const char *_input, int _size,
|
|
208
|
+
char *_output, int _output_size);
|
|
209
|
+
|
|
210
|
+
/* This may be supported on some platforms in the future */
|
|
211
|
+
if (!input) {
|
|
212
|
+
__set_errno(EINVAL);
|
|
213
|
+
return NULL;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (!strncmp(prefix, "$2a$", 4) || !strncmp(prefix, "$2b$", 4) ||
|
|
217
|
+
!strncmp(prefix, "$2y$", 4))
|
|
218
|
+
use = _crypt_gensalt_blowfish_rn;
|
|
219
|
+
else
|
|
220
|
+
if (!strncmp(prefix, "$1$", 3))
|
|
221
|
+
use = _crypt_gensalt_md5_rn;
|
|
222
|
+
else
|
|
223
|
+
if (prefix[0] == '_')
|
|
224
|
+
use = _crypt_gensalt_extended_rn;
|
|
225
|
+
else
|
|
226
|
+
if (!prefix[0] ||
|
|
227
|
+
(prefix[0] && prefix[1] &&
|
|
228
|
+
memchr(_crypt_itoa64, prefix[0], 64) &&
|
|
229
|
+
memchr(_crypt_itoa64, prefix[1], 64)))
|
|
230
|
+
use = _crypt_gensalt_traditional_rn;
|
|
231
|
+
else {
|
|
232
|
+
__set_errno(EINVAL);
|
|
233
|
+
return NULL;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return use(prefix, count, input, size, output, output_size);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
char *__crypt_gensalt_ra(const char *prefix, unsigned long count,
|
|
240
|
+
const char *input, int size)
|
|
241
|
+
{
|
|
242
|
+
char output[CRYPT_GENSALT_OUTPUT_SIZE];
|
|
243
|
+
char *retval;
|
|
244
|
+
|
|
245
|
+
retval = __crypt_gensalt_rn(prefix, count,
|
|
246
|
+
input, size, output, sizeof(output));
|
|
247
|
+
|
|
248
|
+
if (retval) {
|
|
249
|
+
retval = strdup(retval);
|
|
250
|
+
#ifndef __GLIBC__
|
|
251
|
+
/* strdup(3) on glibc sets errno, so we don't need to bother */
|
|
252
|
+
if (!retval)
|
|
253
|
+
__set_errno(ENOMEM);
|
|
254
|
+
#endif
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return retval;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
char *__crypt_gensalt(const char *prefix, unsigned long count,
|
|
261
|
+
const char *input, int size)
|
|
262
|
+
{
|
|
263
|
+
static char output[CRYPT_GENSALT_OUTPUT_SIZE];
|
|
264
|
+
|
|
265
|
+
return __crypt_gensalt_rn(prefix, count,
|
|
266
|
+
input, size, output, sizeof(output));
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
#if defined(__GLIBC__) && defined(_LIBC)
|
|
270
|
+
weak_alias(__crypt_rn, crypt_rn)
|
|
271
|
+
weak_alias(__crypt_ra, crypt_ra)
|
|
272
|
+
weak_alias(__crypt_r, crypt_r)
|
|
273
|
+
weak_alias(__crypt, crypt)
|
|
274
|
+
weak_alias(__crypt_gensalt_rn, crypt_gensalt_rn)
|
|
275
|
+
weak_alias(__crypt_gensalt_ra, crypt_gensalt_ra)
|
|
276
|
+
weak_alias(__crypt_gensalt, crypt_gensalt)
|
|
277
|
+
weak_alias(crypt, fcrypt)
|
|
278
|
+
#endif
|
|
279
|
+
|
|
280
|
+
#ifdef TEST
|
|
281
|
+
static const char *tests[][3] = {
|
|
282
|
+
{"$2a$05$CCCCCCCCCCCCCCCCCCCCC.E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW",
|
|
283
|
+
"U*U"},
|
|
284
|
+
{"$2a$05$CCCCCCCCCCCCCCCCCCCCC.VGOzA784oUp/Z0DY336zx7pLYAy0lwK",
|
|
285
|
+
"U*U*"},
|
|
286
|
+
{"$2a$05$XXXXXXXXXXXXXXXXXXXXXOAcXxm9kjPGEMsLznoKqmqw7tc8WCx4a",
|
|
287
|
+
"U*U*U"},
|
|
288
|
+
{"$2a$05$abcdefghijklmnopqrstuu5s2v8.iXieOjg/.AySBTTZIIVFJeBui",
|
|
289
|
+
"0123456789abcdefghijklmnopqrstuvwxyz"
|
|
290
|
+
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
291
|
+
"chars after 72 are ignored"},
|
|
292
|
+
{"$2x$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e",
|
|
293
|
+
"\xa3"},
|
|
294
|
+
{"$2x$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e",
|
|
295
|
+
"\xff\xff\xa3"},
|
|
296
|
+
{"$2y$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e",
|
|
297
|
+
"\xff\xff\xa3"},
|
|
298
|
+
{"$2a$05$/OK.fbVrR/bpIqNJ5ianF.nqd1wy.pTMdcvrRWxyiGL2eMz.2a85.",
|
|
299
|
+
"\xff\xff\xa3"},
|
|
300
|
+
{"$2b$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e",
|
|
301
|
+
"\xff\xff\xa3"},
|
|
302
|
+
{"$2y$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq",
|
|
303
|
+
"\xa3"},
|
|
304
|
+
{"$2a$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq",
|
|
305
|
+
"\xa3"},
|
|
306
|
+
{"$2b$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq",
|
|
307
|
+
"\xa3"},
|
|
308
|
+
{"$2x$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi",
|
|
309
|
+
"1\xa3" "345"},
|
|
310
|
+
{"$2x$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi",
|
|
311
|
+
"\xff\xa3" "345"},
|
|
312
|
+
{"$2x$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi",
|
|
313
|
+
"\xff\xa3" "34" "\xff\xff\xff\xa3" "345"},
|
|
314
|
+
{"$2y$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi",
|
|
315
|
+
"\xff\xa3" "34" "\xff\xff\xff\xa3" "345"},
|
|
316
|
+
{"$2a$05$/OK.fbVrR/bpIqNJ5ianF.ZC1JEJ8Z4gPfpe1JOr/oyPXTWl9EFd.",
|
|
317
|
+
"\xff\xa3" "34" "\xff\xff\xff\xa3" "345"},
|
|
318
|
+
{"$2y$05$/OK.fbVrR/bpIqNJ5ianF.nRht2l/HRhr6zmCp9vYUvvsqynflf9e",
|
|
319
|
+
"\xff\xa3" "345"},
|
|
320
|
+
{"$2a$05$/OK.fbVrR/bpIqNJ5ianF.nRht2l/HRhr6zmCp9vYUvvsqynflf9e",
|
|
321
|
+
"\xff\xa3" "345"},
|
|
322
|
+
{"$2a$05$/OK.fbVrR/bpIqNJ5ianF.6IflQkJytoRVc1yuaNtHfiuq.FRlSIS",
|
|
323
|
+
"\xa3" "ab"},
|
|
324
|
+
{"$2x$05$/OK.fbVrR/bpIqNJ5ianF.6IflQkJytoRVc1yuaNtHfiuq.FRlSIS",
|
|
325
|
+
"\xa3" "ab"},
|
|
326
|
+
{"$2y$05$/OK.fbVrR/bpIqNJ5ianF.6IflQkJytoRVc1yuaNtHfiuq.FRlSIS",
|
|
327
|
+
"\xa3" "ab"},
|
|
328
|
+
{"$2x$05$6bNw2HLQYeqHYyBfLMsv/OiwqTymGIGzFsA4hOTWebfehXHNprcAS",
|
|
329
|
+
"\xd1\x91"},
|
|
330
|
+
{"$2x$05$6bNw2HLQYeqHYyBfLMsv/O9LIGgn8OMzuDoHfof8AQimSGfcSWxnS",
|
|
331
|
+
"\xd0\xc1\xd2\xcf\xcc\xd8"},
|
|
332
|
+
{"$2a$05$/OK.fbVrR/bpIqNJ5ianF.swQOIzjOiJ9GHEPuhEkvqrUyvWhEMx6",
|
|
333
|
+
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
|
|
334
|
+
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
|
|
335
|
+
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
|
|
336
|
+
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
|
|
337
|
+
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
|
|
338
|
+
"\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa"
|
|
339
|
+
"chars after 72 are ignored as usual"},
|
|
340
|
+
{"$2a$05$/OK.fbVrR/bpIqNJ5ianF.R9xrDjiycxMbQE2bp.vgqlYpW5wx2yy",
|
|
341
|
+
"\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55"
|
|
342
|
+
"\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55"
|
|
343
|
+
"\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55"
|
|
344
|
+
"\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55"
|
|
345
|
+
"\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55"
|
|
346
|
+
"\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55"},
|
|
347
|
+
{"$2a$05$/OK.fbVrR/bpIqNJ5ianF.9tQZzcJfm3uj2NvJ/n5xkhpqLrMpWCe",
|
|
348
|
+
"\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff"
|
|
349
|
+
"\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff"
|
|
350
|
+
"\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff"
|
|
351
|
+
"\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff"
|
|
352
|
+
"\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff"
|
|
353
|
+
"\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff"},
|
|
354
|
+
{"$2a$05$CCCCCCCCCCCCCCCCCCCCC.7uG0VCzI2bS7j6ymqJi9CdcdxiRTWNy",
|
|
355
|
+
""},
|
|
356
|
+
{"*0", "", "$2a$03$CCCCCCCCCCCCCCCCCCCCC."},
|
|
357
|
+
{"*0", "", "$2a$32$CCCCCCCCCCCCCCCCCCCCC."},
|
|
358
|
+
{"*0", "", "$2c$05$CCCCCCCCCCCCCCCCCCCCC."},
|
|
359
|
+
{"*0", "", "$2z$05$CCCCCCCCCCCCCCCCCCCCC."},
|
|
360
|
+
{"*0", "", "$2`$05$CCCCCCCCCCCCCCCCCCCCC."},
|
|
361
|
+
{"*0", "", "$2{$05$CCCCCCCCCCCCCCCCCCCCC."},
|
|
362
|
+
{"*1", "", "*0"},
|
|
363
|
+
{NULL}
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
#define which tests[0]
|
|
367
|
+
|
|
368
|
+
static volatile sig_atomic_t running;
|
|
369
|
+
|
|
370
|
+
static void handle_timer(int signum)
|
|
371
|
+
{
|
|
372
|
+
(void) signum;
|
|
373
|
+
running = 0;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
static void *run(void *arg)
|
|
377
|
+
{
|
|
378
|
+
unsigned long count = 0;
|
|
379
|
+
int i = 0;
|
|
380
|
+
void *data = NULL;
|
|
381
|
+
int size = 0x12345678;
|
|
382
|
+
|
|
383
|
+
do {
|
|
384
|
+
const char *hash = tests[i][0];
|
|
385
|
+
const char *key = tests[i][1];
|
|
386
|
+
const char *setting = tests[i][2];
|
|
387
|
+
|
|
388
|
+
if (!tests[++i][0])
|
|
389
|
+
i = 0;
|
|
390
|
+
|
|
391
|
+
if (setting && strlen(hash) < 30) /* not for benchmark */
|
|
392
|
+
continue;
|
|
393
|
+
|
|
394
|
+
if (strcmp(crypt_ra(key, hash, &data, &size), hash)) {
|
|
395
|
+
printf("%d: FAILED (crypt_ra/%d/%lu)\n",
|
|
396
|
+
(int)((char *)arg - (char *)0), i, count);
|
|
397
|
+
free(data);
|
|
398
|
+
return NULL;
|
|
399
|
+
}
|
|
400
|
+
count++;
|
|
401
|
+
} while (running);
|
|
402
|
+
|
|
403
|
+
free(data);
|
|
404
|
+
return count + (char *)0;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
int main(void)
|
|
408
|
+
{
|
|
409
|
+
struct itimerval it;
|
|
410
|
+
struct tms buf;
|
|
411
|
+
clock_t clk_tck, start_real, start_virtual, end_real, end_virtual;
|
|
412
|
+
unsigned long count;
|
|
413
|
+
void *data;
|
|
414
|
+
int size;
|
|
415
|
+
char *setting1, *setting2;
|
|
416
|
+
int i;
|
|
417
|
+
#ifdef TEST_THREADS
|
|
418
|
+
pthread_t t[TEST_THREADS];
|
|
419
|
+
void *t_retval;
|
|
420
|
+
#endif
|
|
421
|
+
|
|
422
|
+
data = NULL;
|
|
423
|
+
size = 0x12345678;
|
|
424
|
+
|
|
425
|
+
for (i = 0; tests[i][0]; i++) {
|
|
426
|
+
const char *hash = tests[i][0];
|
|
427
|
+
const char *key = tests[i][1];
|
|
428
|
+
const char *setting = tests[i][2];
|
|
429
|
+
const char *p;
|
|
430
|
+
int ok = !setting || strlen(hash) >= 30;
|
|
431
|
+
int o_size;
|
|
432
|
+
char s_buf[30], o_buf[61];
|
|
433
|
+
if (!setting) {
|
|
434
|
+
memcpy(s_buf, hash, sizeof(s_buf) - 1);
|
|
435
|
+
s_buf[sizeof(s_buf) - 1] = 0;
|
|
436
|
+
setting = s_buf;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
__set_errno(0);
|
|
440
|
+
p = crypt(key, setting);
|
|
441
|
+
if ((!ok && !errno) || strcmp(p, hash)) {
|
|
442
|
+
printf("FAILED (crypt/%d)\n", i);
|
|
443
|
+
return 1;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
if (ok && strcmp(crypt(key, hash), hash)) {
|
|
447
|
+
printf("FAILED (crypt/%d)\n", i);
|
|
448
|
+
return 1;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
for (o_size = -1; o_size <= (int)sizeof(o_buf); o_size++) {
|
|
452
|
+
int ok_n = ok && o_size == (int)sizeof(o_buf);
|
|
453
|
+
const char *x = "abc";
|
|
454
|
+
strcpy(o_buf, x);
|
|
455
|
+
if (o_size >= 3) {
|
|
456
|
+
x = "*0";
|
|
457
|
+
if (setting[0] == '*' && setting[1] == '0')
|
|
458
|
+
x = "*1";
|
|
459
|
+
}
|
|
460
|
+
__set_errno(0);
|
|
461
|
+
p = crypt_rn(key, setting, o_buf, o_size);
|
|
462
|
+
if ((ok_n && (!p || strcmp(p, hash))) ||
|
|
463
|
+
(!ok_n && (!errno || p || strcmp(o_buf, x)))) {
|
|
464
|
+
printf("FAILED (crypt_rn/%d)\n", i);
|
|
465
|
+
return 1;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
__set_errno(0);
|
|
470
|
+
p = crypt_ra(key, setting, &data, &size);
|
|
471
|
+
if ((ok && (!p || strcmp(p, hash))) ||
|
|
472
|
+
(!ok && (!errno || p || strcmp((char *)data, hash)))) {
|
|
473
|
+
printf("FAILED (crypt_ra/%d)\n", i);
|
|
474
|
+
return 1;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
setting1 = crypt_gensalt(which[0], 12, data, size);
|
|
479
|
+
if (!setting1 || strncmp(setting1, "$2a$12$", 7)) {
|
|
480
|
+
puts("FAILED (crypt_gensalt)\n");
|
|
481
|
+
return 1;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
setting2 = crypt_gensalt_ra(setting1, 12, data, size);
|
|
485
|
+
if (strcmp(setting1, setting2)) {
|
|
486
|
+
puts("FAILED (crypt_gensalt_ra/1)\n");
|
|
487
|
+
return 1;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
(*(char *)data)++;
|
|
491
|
+
setting1 = crypt_gensalt_ra(setting2, 12, data, size);
|
|
492
|
+
if (!strcmp(setting1, setting2)) {
|
|
493
|
+
puts("FAILED (crypt_gensalt_ra/2)\n");
|
|
494
|
+
return 1;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
free(setting1);
|
|
498
|
+
free(setting2);
|
|
499
|
+
free(data);
|
|
500
|
+
|
|
501
|
+
#if defined(_SC_CLK_TCK) || !defined(CLK_TCK)
|
|
502
|
+
clk_tck = sysconf(_SC_CLK_TCK);
|
|
503
|
+
#else
|
|
504
|
+
clk_tck = CLK_TCK;
|
|
505
|
+
#endif
|
|
506
|
+
|
|
507
|
+
running = 1;
|
|
508
|
+
signal(SIGALRM, handle_timer);
|
|
509
|
+
|
|
510
|
+
memset(&it, 0, sizeof(it));
|
|
511
|
+
it.it_value.tv_sec = 5;
|
|
512
|
+
setitimer(ITIMER_REAL, &it, NULL);
|
|
513
|
+
|
|
514
|
+
start_real = times(&buf);
|
|
515
|
+
start_virtual = buf.tms_utime + buf.tms_stime;
|
|
516
|
+
|
|
517
|
+
count = (char *)run((char *)0) - (char *)0;
|
|
518
|
+
|
|
519
|
+
end_real = times(&buf);
|
|
520
|
+
end_virtual = buf.tms_utime + buf.tms_stime;
|
|
521
|
+
if (end_virtual == start_virtual) end_virtual++;
|
|
522
|
+
|
|
523
|
+
printf("%.1f c/s real, %.1f c/s virtual\n",
|
|
524
|
+
(float)count * clk_tck / (end_real - start_real),
|
|
525
|
+
(float)count * clk_tck / (end_virtual - start_virtual));
|
|
526
|
+
|
|
527
|
+
#ifdef TEST_THREADS
|
|
528
|
+
running = 1;
|
|
529
|
+
it.it_value.tv_sec = 60;
|
|
530
|
+
setitimer(ITIMER_REAL, &it, NULL);
|
|
531
|
+
start_real = times(&buf);
|
|
532
|
+
|
|
533
|
+
for (i = 0; i < TEST_THREADS; i++)
|
|
534
|
+
if (pthread_create(&t[i], NULL, run, i + (char *)0)) {
|
|
535
|
+
perror("pthread_create");
|
|
536
|
+
return 1;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
for (i = 0; i < TEST_THREADS; i++) {
|
|
540
|
+
if (pthread_join(t[i], &t_retval)) {
|
|
541
|
+
perror("pthread_join");
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
if (!t_retval) continue;
|
|
545
|
+
count = (char *)t_retval - (char *)0;
|
|
546
|
+
end_real = times(&buf);
|
|
547
|
+
printf("%d: %.1f c/s real\n", i,
|
|
548
|
+
(float)count * clk_tck / (end_real - start_real));
|
|
549
|
+
}
|
|
550
|
+
#endif
|
|
551
|
+
|
|
552
|
+
return 0;
|
|
553
|
+
}
|
|
554
|
+
#endif
|