From: merch-redmine@... Date: 2015-07-18T15:33:41+00:00 Subject: [ruby-core:70031] [Ruby trunk - Bug #11363] Fix tests for String#crypt Issue #11363 has been updated by Jeremy Evans. Well, the tests fail on OpenBSD regardless of the patch, as OpenBSD crypt(3) does not support the historical, insecure DES-based crypt, only bcrypt, and you need to pass a bcrypt salt as the second argument. I will be adding a local patch to OpenBSD so that passing a non-bcrypt salt to String#crypt will result in a bcrypt salt being autogenerated, so that portable ruby programs using String#crypt will run on OpenBSD. I don't think that patch belongs in ruby. I think this patch improves things as it allows implementations to choose how to implement crypt(3), as long as they their crypt has the property: enc = "pass".crypt("salt") enc == "pass".crypt(enc) This isn't a big deal, I'm fine keeping this as a local OpenBSD patch, but I think it makes sense to have this in ruby. If you disagree, feel free to close this issue. ---------------------------------------- Bug #11363: Fix tests for String#crypt https://bugs.ruby-lang.org/issues/11363#change-53455 * Author: Jeremy Evans * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.3.0dev (2015-07-16 openbsd 51261) [x86_64-openbsd] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- The String#crypt documentation states "the format and the result are system and implementation dependent", so the tests should not be checking for specific results. We should only be checking that the method returns a string, that the results are different if you use a different password or different salt, and the results are the same if the using the encypted password as the salt results in the same encrypted password. ---Files-------------------------------- 0001-Fix-tests-for-String-crypt.patch (2.02 KB) -- https://bugs.ruby-lang.org/