Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crypto/pkcs8/pkcs8_x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey) {
PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *pkcs8, const char *pass,
int pass_len_in) {
size_t pass_len;
if (pass_len_in == -1 && pass != NULL) {
if (pass_len_in < 0 && pass != NULL) {
pass_len = strlen(pass);
} else {
pass_len = (size_t)pass_len_in;
Expand Down
6 changes: 4 additions & 2 deletions include/openssl/pkcs8.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ extern "C" {
// |pass| is used as the password. If a PBES1 scheme from PKCS #12 is used, this
// will be converted to a raw byte string as specified in B.1 of PKCS #12. If
// |pass| is NULL, it will be encoded as the empty byte string rather than two
// zero bytes, the PKCS #12 encoding of the empty string.
// zero bytes, the PKCS #12 encoding of the empty string. If |pass_len| is
// negative and |pass| is non-NULL, |strlen(pass)| is used.
//
// If |salt| is NULL, a random salt of |salt_len| bytes is generated. If
// |salt_len| is zero, a default salt length is used instead.
Expand Down Expand Up @@ -104,7 +105,8 @@ OPENSSL_EXPORT int PKCS8_marshal_encrypted_private_key(
// |pass| is used as the password. If a PBES1 scheme from PKCS #12 is used, this
// will be converted to a raw byte string as specified in B.1 of PKCS #12. If
// |pass| is NULL, it will be encoded as the empty byte string rather than two
// zero bytes, the PKCS #12 encoding of the empty string.
// zero bytes, the PKCS #12 encoding of the empty string. If |pass_len| is
// negative and |pass| is non-NULL, |strlen(pass)| is used.
//
// The resulting structure must be freed by the caller.
OPENSSL_EXPORT PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *pkcs8,
Expand Down
Loading