diff options
author | djm <> | 2011-11-03 02:32:23 +0000 |
---|---|---|
committer | djm <> | 2011-11-03 02:32:23 +0000 |
commit | fa3384eda96e42a23f6d3208998246abda2535c1 (patch) | |
tree | d7ee8f9bcd8062ffa41dd1e250e04de24159ee80 /src/lib/libcrypto/pem | |
parent | 154527e9cde3004ed29ea1316880670ec73dcafa (diff) | |
parent | 113f799ec7d1728f0a5d7ab5b0e3b42e3de56407 (diff) | |
download | openbsd-fa3384eda96e42a23f6d3208998246abda2535c1.tar.gz openbsd-fa3384eda96e42a23f6d3208998246abda2535c1.tar.bz2 openbsd-fa3384eda96e42a23f6d3208998246abda2535c1.zip |
This commit was generated by cvs2git to track changes on a CVS vendor
branch.
Diffstat (limited to 'src/lib/libcrypto/pem')
-rw-r--r-- | src/lib/libcrypto/pem/pvkfmt.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/libcrypto/pem/pvkfmt.c b/src/lib/libcrypto/pem/pvkfmt.c index d998a67fa5..5f130c4528 100644 --- a/src/lib/libcrypto/pem/pvkfmt.c +++ b/src/lib/libcrypto/pem/pvkfmt.c | |||
@@ -662,7 +662,7 @@ static int do_PVK_header(const unsigned char **in, unsigned int length, | |||
662 | 662 | ||
663 | { | 663 | { |
664 | const unsigned char *p = *in; | 664 | const unsigned char *p = *in; |
665 | unsigned int pvk_magic, keytype, is_encrypted; | 665 | unsigned int pvk_magic, is_encrypted; |
666 | if (skip_magic) | 666 | if (skip_magic) |
667 | { | 667 | { |
668 | if (length < 20) | 668 | if (length < 20) |
@@ -689,7 +689,7 @@ static int do_PVK_header(const unsigned char **in, unsigned int length, | |||
689 | } | 689 | } |
690 | /* Skip reserved */ | 690 | /* Skip reserved */ |
691 | p += 4; | 691 | p += 4; |
692 | keytype = read_ledword(&p); | 692 | /*keytype = */read_ledword(&p); |
693 | is_encrypted = read_ledword(&p); | 693 | is_encrypted = read_ledword(&p); |
694 | *psaltlen = read_ledword(&p); | 694 | *psaltlen = read_ledword(&p); |
695 | *pkeylen = read_ledword(&p); | 695 | *pkeylen = read_ledword(&p); |
@@ -839,7 +839,7 @@ EVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u) | |||
839 | static int i2b_PVK(unsigned char **out, EVP_PKEY*pk, int enclevel, | 839 | static int i2b_PVK(unsigned char **out, EVP_PKEY*pk, int enclevel, |
840 | pem_password_cb *cb, void *u) | 840 | pem_password_cb *cb, void *u) |
841 | { | 841 | { |
842 | int outlen = 24, noinc, pklen; | 842 | int outlen = 24, pklen; |
843 | unsigned char *p, *salt = NULL; | 843 | unsigned char *p, *salt = NULL; |
844 | if (enclevel) | 844 | if (enclevel) |
845 | outlen += PVK_SALTLEN; | 845 | outlen += PVK_SALTLEN; |
@@ -850,10 +850,7 @@ static int i2b_PVK(unsigned char **out, EVP_PKEY*pk, int enclevel, | |||
850 | if (!out) | 850 | if (!out) |
851 | return outlen; | 851 | return outlen; |
852 | if (*out) | 852 | if (*out) |
853 | { | ||
854 | p = *out; | 853 | p = *out; |
855 | noinc = 0; | ||
856 | } | ||
857 | else | 854 | else |
858 | { | 855 | { |
859 | p = OPENSSL_malloc(outlen); | 856 | p = OPENSSL_malloc(outlen); |
@@ -863,7 +860,6 @@ static int i2b_PVK(unsigned char **out, EVP_PKEY*pk, int enclevel, | |||
863 | return -1; | 860 | return -1; |
864 | } | 861 | } |
865 | *out = p; | 862 | *out = p; |
866 | noinc = 1; | ||
867 | } | 863 | } |
868 | 864 | ||
869 | write_ledword(&p, MS_PVKMAGIC); | 865 | write_ledword(&p, MS_PVKMAGIC); |