summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/pem/pem_lib.c
diff options
context:
space:
mode:
authordjm <>2005-04-29 05:39:33 +0000
committerdjm <>2005-04-29 05:39:33 +0000
commit68edd00d9258df93b1366c71ac124e0cadf7bc08 (patch)
tree3ce4ae2a9747bbc11aed1f95f9bbea92c41f8683 /src/lib/libcrypto/pem/pem_lib.c
parentf396ed0f5ce0af56bfde2e75e15cf1f52924c779 (diff)
downloadopenbsd-68edd00d9258df93b1366c71ac124e0cadf7bc08.tar.gz
openbsd-68edd00d9258df93b1366c71ac124e0cadf7bc08.tar.bz2
openbsd-68edd00d9258df93b1366c71ac124e0cadf7bc08.zip
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/pem/pem_lib.c')
-rw-r--r--src/lib/libcrypto/pem/pem_lib.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c
index 7785039b99..82815067b3 100644
--- a/src/lib/libcrypto/pem/pem_lib.c
+++ b/src/lib/libcrypto/pem/pem_lib.c
@@ -73,7 +73,7 @@ const char *PEM_version="PEM" OPENSSL_VERSION_PTEXT;
73 73
74#define MIN_LENGTH 4 74#define MIN_LENGTH 4
75 75
76static int load_iv(unsigned char **fromp,unsigned char *to, int num); 76static int load_iv(char **fromp,unsigned char *to, int num);
77static int check_pem(const char *nm, const char *name); 77static int check_pem(const char *nm, const char *name);
78 78
79int PEM_def_callback(char *buf, int num, int w, void *key) 79int PEM_def_callback(char *buf, int num, int w, void *key)
@@ -301,7 +301,7 @@ int PEM_ASN1_write_bio(int (*i2d)(), const char *name, BIO *bp, char *x,
301 301
302 if ((dsize=i2d(x,NULL)) < 0) 302 if ((dsize=i2d(x,NULL)) < 0)
303 { 303 {
304 PEMerr(PEM_F_PEM_ASN1_WRITE_BIO,ERR_R_MALLOC_FAILURE); 304 PEMerr(PEM_F_PEM_ASN1_WRITE_BIO,ERR_R_ASN1_LIB);
305 dsize=0; 305 dsize=0;
306 goto err; 306 goto err;
307 } 307 }
@@ -432,6 +432,7 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
432 int o; 432 int o;
433 const EVP_CIPHER *enc=NULL; 433 const EVP_CIPHER *enc=NULL;
434 char *p,c; 434 char *p,c;
435 char **header_pp = &header;
435 436
436 cipher->cipher=NULL; 437 cipher->cipher=NULL;
437 if ((header == NULL) || (*header == '\0') || (*header == '\n')) 438 if ((header == NULL) || (*header == '\0') || (*header == '\n'))
@@ -478,15 +479,16 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
478 PEMerr(PEM_F_PEM_GET_EVP_CIPHER_INFO,PEM_R_UNSUPPORTED_ENCRYPTION); 479 PEMerr(PEM_F_PEM_GET_EVP_CIPHER_INFO,PEM_R_UNSUPPORTED_ENCRYPTION);
479 return(0); 480 return(0);
480 } 481 }
481 if (!load_iv((unsigned char **)&header,&(cipher->iv[0]),enc->iv_len)) return(0); 482 if (!load_iv(header_pp,&(cipher->iv[0]),enc->iv_len))
483 return(0);
482 484
483 return(1); 485 return(1);
484 } 486 }
485 487
486static int load_iv(unsigned char **fromp, unsigned char *to, int num) 488static int load_iv(char **fromp, unsigned char *to, int num)
487 { 489 {
488 int v,i; 490 int v,i;
489 unsigned char *from; 491 char *from;
490 492
491 from= *fromp; 493 from= *fromp;
492 for (i=0; i<num; i++) to[i]=0; 494 for (i=0; i<num; i++) to[i]=0;
@@ -623,6 +625,9 @@ int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data,
623 dataB=BUF_MEM_new(); 625 dataB=BUF_MEM_new();
624 if ((nameB == NULL) || (headerB == NULL) || (dataB == NULL)) 626 if ((nameB == NULL) || (headerB == NULL) || (dataB == NULL))
625 { 627 {
628 BUF_MEM_free(nameB);
629 BUF_MEM_free(headerB);
630 BUF_MEM_free(dataB);
626 PEMerr(PEM_F_PEM_READ_BIO,ERR_R_MALLOC_FAILURE); 631 PEMerr(PEM_F_PEM_READ_BIO,ERR_R_MALLOC_FAILURE);
627 return(0); 632 return(0);
628 } 633 }