pike.git
/
src
/
post_modules
/
Nettle
/
nettle.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/post_modules/Nettle/nettle.cmod:102:
*/ PIKEFUN string(7bit) bcrypt_hash(string(8bit) password, string(7bit) scheme, string(8bit)|void salt, int|void log2rounds) { int retval; struct string_builder ret; password->flags |= STRING_CLEAR_ON_EXIT; if (salt) NO_WIDE_STRING(salt); init_string_builder_alloc(&ret, BLOWFISH_BCRYPT_HASH_SIZE, 0);
-
retval = nettle_blowfish_bcrypt_hash(
BLOWFISH_BCRYPT_HASH_SIZE,
STR0(ret.s),
-
STR0(password), STR0(scheme),
+
retval = nettle_blowfish_bcrypt_hash(STR0(ret.s),
+
password->len,
STR0(password),
scheme->len,
STR0(scheme),
log2rounds ? log2rounds->u.integer : -1, salt && salt->len >= BLOWFISH_BCRYPT_BINSALT_SIZE ? STR0(salt) : NULL); if (!retval) { free_string_builder(&ret); Pike_error("Invalid password hash scheme for bcrypt.\n"); } ret.s->len = strlen(STR0(ret.s)); RETURN finish_string_builder(&ret); }
pike.git/src/post_modules/Nettle/nettle.cmod:137:
*! *! @note *! You should normally use @[Crypto.Password] instead. *! *! @seealso *! @[Crypto.Password], @[Crypto.BLOWFISH] */ PIKEFUN int bcrypt_verify(string(8bit) password, string(7bit) hashedpassword) { password->flags |= STRING_CLEAR_ON_EXIT;
-
RETURN nettle_blowfish_bcrypt_verify(STR0(password), STR0(hashedpassword));
+
RETURN nettle_blowfish_bcrypt_verify(
password->len,
STR0(password),
+
hashedpassword->len,
STR0(hashedpassword));
} #endif /*! @class Yarrow *! *! Yarrow is a family of pseudo-randomness generators, designed for *! cryptographic use, by John Kelsey, Bruce Schneier and Niels Ferguson. *! Yarrow-160 is described in a paper at *! @url{http://www.schneier.com/paper-yarrow.html@}, and it uses SHA1 and *! triple-DES, and has a 160-bit internal state. Nettle implements