Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-bcrypt for openSUSE:Factory checked in at 2022-06-15 00:32:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-bcrypt (Old) and /work/SRC/openSUSE:Factory/.rubygem-bcrypt.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-bcrypt" Wed Jun 15 00:32:14 2022 rev:13 rq:982526 version:3.1.18 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-bcrypt/rubygem-bcrypt.changes 2022-04-30 22:52:31.980223860 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-bcrypt.new.1548/rubygem-bcrypt.changes 2022-06-15 00:32:17.818526271 +0200 @@ -1,0 +2,8 @@ +Mon Jun 13 16:50:26 UTC 2022 - Manuel Schnitzer <[email protected]> + +- updated to version 3.1.18 + + * Unlock GVL when calculating hashes and salts [GH #260] + * Fix compilation warnings in `ext/mri/bcrypt_ext.c` [GH #261] + +------------------------------------------------------------------- Old: ---- bcrypt-3.1.17.gem New: ---- bcrypt-3.1.18.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-bcrypt.spec ++++++ --- /var/tmp/diff_new_pack.8DovCb/_old 2022-06-15 00:32:18.426527165 +0200 +++ /var/tmp/diff_new_pack.8DovCb/_new 2022-06-15 00:32:18.434527176 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-bcrypt -Version: 3.1.17 +Version: 3.1.18 Release: 0 %define mod_name bcrypt %define mod_full_name %{mod_name}-%{version} ++++++ bcrypt-3.1.17.gem -> bcrypt-3.1.18.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.github/workflows/ruby.yml new/.github/workflows/ruby.yml --- old/.github/workflows/ruby.yml 2022-03-14 20:16:53.000000000 +0100 +++ new/.github/workflows/ruby.yml 2022-05-17 00:55:39.000000000 +0200 @@ -30,8 +30,6 @@ - truffleruby-head - mingw exclude: - - { os: ubuntu, ruby: jruby } - - { os: ubuntu, ruby: jruby-head } - { os: ubuntu, ruby: mingw } - { os: macos, ruby: mingw } - { os: windows, ruby: truffleruby } @@ -46,8 +44,12 @@ with: ruby-version: ${{ matrix.ruby }} bundler-cache: true + env: + JAVA_OPTS: -Djdk.io.File.enableADS=true - name: Run tests run: bundle exec rake default + env: + JAVA_OPTS: -Djdk.io.File.enableADS=true finish: runs-on: ubuntu-latest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG new/CHANGELOG --- old/CHANGELOG 2022-03-14 20:16:53.000000000 +0100 +++ new/CHANGELOG 2022-05-17 00:55:39.000000000 +0200 @@ -1,3 +1,7 @@ +3.1.18 May 16 2022 + - Unlock GVL when calculating hashes and salts [GH #260] + - Fix compilation warnings in `ext/mri/bcrypt_ext.c` [GH #261] + 3.1.17 Mar 14 2022 - Fix regex in validators to use \A and \z instead of ^ and $ [GH #121] - Truncate secrets greater than 72 bytes in hash_secret [GH #255] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2022-03-14 20:16:53.000000000 +0100 +++ new/README.md 2022-05-17 00:55:39.000000000 +0200 @@ -5,7 +5,6 @@ * https://github.com/bcrypt-ruby/bcrypt-ruby/tree/master [](https://github.com/bcrypt-ruby/bcrypt-ruby/actions/workflows/ruby.yml) -[](https://ci.appveyor.com/project/TJSchuck35975/bcrypt-ruby) ## Why you should use `bcrypt()` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/appveyor.yml new/appveyor.yml --- old/appveyor.yml 2022-03-14 20:16:53.000000000 +0100 +++ new/appveyor.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,50 +0,0 @@ -version: "{branch}-{build}" -build: off -clone_depth: 1 - -init: - # Install Ruby head - - if %RUBY_VERSION%==head ( - appveyor DownloadFile https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x86.exe -FileName C:\head_x86.exe & - C:\head_x86.exe /verysilent /dir=C:\Ruby%RUBY_VERSION% - ) - - if %RUBY_VERSION%==head-x64 ( - appveyor DownloadFile https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-head/rubyinstaller-head-x64.exe -FileName C:\head_x64.exe & - C:\head_x64.exe /verysilent /dir=C:\Ruby%RUBY_VERSION% - ) - - # Add Ruby to the path - - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH% - -environment: - matrix: - - RUBY_VERSION: "head" - - RUBY_VERSION: "head-x64" - - RUBY_VERSION: "25" - - RUBY_VERSION: "25-x64" - - RUBY_VERSION: "24" - - RUBY_VERSION: "24-x64" - - RUBY_VERSION: "23" - - RUBY_VERSION: "23-x64" - - RUBY_VERSION: "22" - - RUBY_VERSION: "22-x64" - - RUBY_VERSION: "21" - - RUBY_VERSION: "21-x64" - - RUBY_VERSION: "200" - - RUBY_VERSION: "200-x64" - -install: - - ps: "Set-Content -Value 'gem: --no-ri --no-rdoc ' -Path C:\\ProgramData\\gemrc" - - if %RUBY_VERSION%==head ( gem install bundler -v'< 2' ) - - if %RUBY_VERSION%==head-x64 ( gem install bundler -v'< 2' ) - - bundle install - -before_build: - - ruby -v - - gem -v - -build_script: - - bundle exec rake compile -rdevkit - -test_script: - - bundle exec rake spec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bcrypt.gemspec new/bcrypt.gemspec --- old/bcrypt.gemspec 2022-03-14 20:16:53.000000000 +0100 +++ new/bcrypt.gemspec 2022-05-17 00:55:39.000000000 +0200 @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'bcrypt' - s.version = '3.1.17' + s.version = '3.1.18' s.summary = "OpenBSD's bcrypt() password hashing algorithm." s.description = <<-EOF @@ -12,7 +12,7 @@ s.files = `git ls-files`.split("\n") s.require_path = 'lib' - s.add_development_dependency 'rake-compiler', '~> 0.9.2' + s.add_development_dependency 'rake-compiler', '~> 1.2.0' s.add_development_dependency 'rspec', '>= 3' s.rdoc_options += ['--title', 'bcrypt-ruby', '--line-numbers', '--inline-source', '--main', 'README.md'] Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ext/mri/bcrypt_ext.c new/ext/mri/bcrypt_ext.c --- old/ext/mri/bcrypt_ext.c 2022-03-14 20:16:53.000000000 +0100 +++ new/ext/mri/bcrypt_ext.c 2022-05-17 00:55:39.000000000 +0200 @@ -1,20 +1,50 @@ #include <ruby.h> #include <ow-crypt.h> +#ifdef HAVE_RUBY_THREAD_H +#include <ruby/thread.h> +#endif + static VALUE mBCrypt; static VALUE cBCryptEngine; +struct bc_salt_args { + const char * prefix; + unsigned long count; + const char * input; + int size; +}; + +static void * bc_salt_nogvl(void * ptr) { + struct bc_salt_args * args = ptr; + + return crypt_gensalt_ra(args->prefix, args->count, args->input, args->size); +} + /* Given a logarithmic cost parameter, generates a salt for use with +bc_crypt+. */ static VALUE bc_salt(VALUE self, VALUE prefix, VALUE count, VALUE input) { char * salt; VALUE str_salt; + struct bc_salt_args args; - salt = crypt_gensalt_ra( - StringValuePtr(prefix), - NUM2ULONG(count), - NIL_P(input) ? NULL : StringValuePtr(input), - NIL_P(input) ? 0 : RSTRING_LEN(input)); + /* duplicate the parameters for thread safety. If another thread has a + * reference to the parameters and mutates them while we are working, + * that would be very bad. Duping the strings means that the reference + * isn't shared. */ + prefix = rb_str_new_frozen(prefix); + input = rb_str_new_frozen(input); + + args.prefix = StringValueCStr(prefix); + args.count = NUM2ULONG(count); + args.input = NIL_P(input) ? NULL : StringValuePtr(input); + args.size = NIL_P(input) ? 0 : RSTRING_LEN(input); + +#ifdef HAVE_RUBY_THREAD_H + salt = rb_thread_call_without_gvl(bc_salt_nogvl, &args, NULL, NULL); +#else + salt = bc_salt_nogvl((void *)&args); +#endif if(!salt) return Qnil; @@ -24,30 +54,52 @@ return str_salt; } +struct bc_crypt_args { + const char * key; + const char * setting; + void * data; + int size; +}; + +static void * bc_crypt_nogvl(void * ptr) { + struct bc_crypt_args * args = ptr; + + return crypt_ra(args->key, args->setting, &args->data, &args->size); +} + /* Given a secret and a salt, generates a salted hash (which you can then store safely). */ static VALUE bc_crypt(VALUE self, VALUE key, VALUE setting) { char * value; - void * data; - int size; VALUE out; - data = NULL; - size = 0xDEADBEEF; + struct bc_crypt_args args; if(NIL_P(key) || NIL_P(setting)) return Qnil; - value = crypt_ra( - NIL_P(key) ? NULL : StringValuePtr(key), - NIL_P(setting) ? NULL : StringValuePtr(setting), - &data, - &size); + /* duplicate the parameters for thread safety. If another thread has a + * reference to the parameters and mutates them while we are working, + * that would be very bad. Duping the strings means that the reference + * isn't shared. */ + key = rb_str_new_frozen(key); + setting = rb_str_new_frozen(setting); + + args.data = NULL; + args.size = 0xDEADBEEF; + args.key = NIL_P(key) ? NULL : StringValueCStr(key); + args.setting = NIL_P(setting) ? NULL : StringValueCStr(setting); + +#ifdef HAVE_RUBY_THREAD_H + value = rb_thread_call_without_gvl(bc_crypt_nogvl, &args, NULL, NULL); +#else + value = bc_crypt_nogvl((void *)&args); +#endif - if(!value || !data) return Qnil; + if(!value || !args.data) return Qnil; out = rb_str_new2(value); - xfree(data); + free(args.data); return out; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2022-03-14 20:16:53.000000000 +0100 +++ new/metadata 2022-05-17 00:55:39.000000000 +0200 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: bcrypt version: !ruby/object:Gem::Version - version: 3.1.17 + version: 3.1.18 platform: ruby authors: - Coda Hale autorequire: bindir: bin cert_chain: [] -date: 2022-03-14 00:00:00.000000000 Z +date: 2022-05-16 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: rake-compiler @@ -16,14 +16,14 @@ requirements: - - "~>" - !ruby/object:Gem::Version - version: 0.9.2 + version: 1.2.0 type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version - version: 0.9.2 + version: 1.2.0 - !ruby/object:Gem::Dependency name: rspec requirement: !ruby/object:Gem::Requirement @@ -63,7 +63,6 @@ - Gemfile - README.md - Rakefile -- appveyor.yml - bcrypt.gemspec - ext/jruby/bcrypt_jruby/BCrypt.java - ext/mri/bcrypt_ext.c
