diff options
| author | djm <> | 2011-11-03 02:32:23 +0000 |
|---|---|---|
| committer | djm <> | 2011-11-03 02:32:23 +0000 |
| commit | 113f799ec7d1728f0a5d7ab5b0e3b42e3de56407 (patch) | |
| tree | 26d712b25a8fa580b8f2dfc6df470ba5ffea9eb7 /src/lib/libcrypto/pem | |
| parent | 829fd51d4f8dde4a7f3bf54754f3c1d1a502f5e2 (diff) | |
| download | openbsd-113f799ec7d1728f0a5d7ab5b0e3b42e3de56407.tar.gz openbsd-113f799ec7d1728f0a5d7ab5b0e3b42e3de56407.tar.bz2 openbsd-113f799ec7d1728f0a5d7ab5b0e3b42e3de56407.zip | |
import OpenSSL 1.0.0e
Diffstat (limited to 'src/lib/libcrypto/pem')
| -rw-r--r-- | src/lib/libcrypto/pem/pem_lib.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/pem/pvkfmt.c | 10 |
2 files changed, 3 insertions, 9 deletions
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c index 42e4861bc1..cfc89a9921 100644 --- a/src/lib/libcrypto/pem/pem_lib.c +++ b/src/lib/libcrypto/pem/pem_lib.c | |||
| @@ -482,7 +482,6 @@ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, | |||
| 482 | 482 | ||
| 483 | int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) | 483 | int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) |
| 484 | { | 484 | { |
| 485 | int o; | ||
| 486 | const EVP_CIPHER *enc=NULL; | 485 | const EVP_CIPHER *enc=NULL; |
| 487 | char *p,c; | 486 | char *p,c; |
| 488 | char **header_pp = &header; | 487 | char **header_pp = &header; |
| @@ -522,7 +521,6 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) | |||
| 522 | header++; | 521 | header++; |
| 523 | } | 522 | } |
| 524 | *header='\0'; | 523 | *header='\0'; |
| 525 | o=OBJ_sn2nid(p); | ||
| 526 | cipher->cipher=enc=EVP_get_cipherbyname(p); | 524 | cipher->cipher=enc=EVP_get_cipherbyname(p); |
| 527 | *header=c; | 525 | *header=c; |
| 528 | header++; | 526 | header++; |
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); |
