Branch: Tag:

2019-12-09

2019-12-09 16:50:41 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Crypto.Password: Added support for NetBSD-style crypt_sha1().

261: Inside #if constant(Crypto.SHA512)
   return Crypto.SHA512.crypt_php(passwd, salt) == hash;    break;   #endif +  +  case "sha1": // SHA1-HMAC +  rounds = (int)salt; +  sscanf(hash, "%s$%s", salt, hash); +  return Crypto.SHA1.HMAC.crypt_hash(password, salt, rounds) == +  [string(7bit)]hash; +  break;    }    break;    }
490:    render_hash = render_ldap_hash;    break;    +  case "sha1": +  case "$sha1$": +  // NetBSD-style crypt_sha1(). +  crypt_hash = Crypto.SHA1.HMAC.crypt_hash; +  render_hash = render_old_crypt_hash; +  // Defaults taken from PassLib. +  salt_size = 8; +  rounds = 480000; +  break; +     case "pbkdf2":    case "$pbkdf2$":    crypt_hash = Crypto.SHA1.crypt_pbkdf2;