Deleted Added
full compact
a_digest.c (59191) a_digest.c (68651)
1/* crypto/asn1/a_digest.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 63 unchanged lines hidden (view full) ---

72int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
73 unsigned char *md, unsigned int *len)
74 {
75 EVP_MD_CTX ctx;
76 int i;
77 unsigned char *str,*p;
78
79 i=i2d(data,NULL);
1/* crypto/asn1/a_digest.c */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *

--- 63 unchanged lines hidden (view full) ---

72int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
73 unsigned char *md, unsigned int *len)
74 {
75 EVP_MD_CTX ctx;
76 int i;
77 unsigned char *str,*p;
78
79 i=i2d(data,NULL);
80 if ((str=(unsigned char *)Malloc(i)) == NULL) return(0);
80 if ((str=(unsigned char *)OPENSSL_malloc(i)) == NULL) return(0);
81 p=str;
82 i2d(data,&p);
83
84 EVP_DigestInit(&ctx,type);
85 EVP_DigestUpdate(&ctx,str,i);
86 EVP_DigestFinal(&ctx,md,len);
81 p=str;
82 i2d(data,&p);
83
84 EVP_DigestInit(&ctx,type);
85 EVP_DigestUpdate(&ctx,str,i);
86 EVP_DigestFinal(&ctx,md,len);
87 Free(str);
87 OPENSSL_free(str);
88 return(1);
89 }
90
88 return(1);
89 }
90