summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_digest.c
diff options
context:
space:
mode:
authordjm <>2005-04-29 05:37:34 +0000
committerdjm <>2005-04-29 05:37:34 +0000
commita95585a25ab25668b931a78b7543f707a3354db8 (patch)
treef9e9febf7ac0c8f5d6df761fe70fd613aac06203 /src/lib/libcrypto/asn1/a_digest.c
parent58c08aa241f168c84ce7cc3052454ea59a44eada (diff)
downloadopenbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.gz
openbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.bz2
openbsd-a95585a25ab25668b931a78b7543f707a3354db8.zip
import of openssl-0.9.7g; tested on platforms from alpha to zaurus, ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/asn1/a_digest.c')
-rw-r--r--src/lib/libcrypto/asn1/a_digest.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/a_digest.c b/src/lib/libcrypto/asn1/a_digest.c
index 4931e222a0..7182e9fa5d 100644
--- a/src/lib/libcrypto/asn1/a_digest.c
+++ b/src/lib/libcrypto/asn1/a_digest.c
@@ -65,6 +65,7 @@
65# include <sys/types.h> 65# include <sys/types.h>
66#endif 66#endif
67 67
68#include <openssl/err.h>
68#include <openssl/evp.h> 69#include <openssl/evp.h>
69#include <openssl/buffer.h> 70#include <openssl/buffer.h>
70#include <openssl/x509.h> 71#include <openssl/x509.h>
@@ -78,7 +79,11 @@ int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
78 unsigned char *str,*p; 79 unsigned char *str,*p;
79 80
80 i=i2d(data,NULL); 81 i=i2d(data,NULL);
81 if ((str=(unsigned char *)OPENSSL_malloc(i)) == NULL) return(0); 82 if ((str=(unsigned char *)OPENSSL_malloc(i)) == NULL)
83 {
84 ASN1err(ASN1_F_ASN1_DIGEST,ERR_R_MALLOC_FAILURE);
85 return(0);
86 }
82 p=str; 87 p=str;
83 i2d(data,&p); 88 i2d(data,&p);
84 89