summaryrefslogtreecommitdiffstats
path: root/crypto/pem/pvkfmt.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2019-09-16 21:28:57 +0200
committerRichard Levitte <levitte@openssl.org>2019-10-09 21:32:15 +0200
commit12a765a5235f181c2f4992b615eb5f892c368e88 (patch)
tree67ece1a3fb210bd4895aea73649773fc912a60d6 /crypto/pem/pvkfmt.c
parentRefactor -passin/-passout documentation (diff)
downloadopenssl-12a765a5235f181c2f4992b615eb5f892c368e88.tar.xz
openssl-12a765a5235f181c2f4992b615eb5f892c368e88.zip
Explicitly test against NULL; do not use !p or similar
Also added blanks lines after declarations in a couple of places. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9916)
Diffstat (limited to 'crypto/pem/pvkfmt.c')
-rw-r--r--crypto/pem/pvkfmt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c
index adf2914433..6bcde93d6c 100644
--- a/crypto/pem/pvkfmt.c
+++ b/crypto/pem/pvkfmt.c
@@ -617,6 +617,7 @@ static int do_PVK_header(const unsigned char **in, unsigned int length,
{
const unsigned char *p = *in;
unsigned int pvk_magic, is_encrypted;
+
if (skip_magic) {
if (length < 20) {
PEMerr(PEM_F_DO_PVK_HEADER, PEM_R_PVK_TOO_SHORT);
@@ -645,7 +646,7 @@ static int do_PVK_header(const unsigned char **in, unsigned int length,
if (*pkeylen > PVK_MAX_KEYLEN || *psaltlen > PVK_MAX_SALTLEN)
return 0;
- if (is_encrypted && !*psaltlen) {
+ if (is_encrypted && *psaltlen == 0) {
PEMerr(PEM_F_DO_PVK_HEADER, PEM_R_INCONSISTENT_HEADER);
return 0;
}