projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Extend OID config module format.
[oweals/openssl.git]
/
crypto
/
asn1
/
a_digest.c
diff --git
a/crypto/asn1/a_digest.c
b/crypto/asn1/a_digest.c
index fb4686fdbd17c4dfcb7bd93cadb2e377108df8bf..4931e222a05e30c0f47e530f18b05bbe29657049 100644
(file)
--- a/
crypto/asn1/a_digest.c
+++ b/
crypto/asn1/a_digest.c
@@
-69,10
+69,11
@@
#include <openssl/buffer.h>
#include <openssl/x509.h>
#include <openssl/buffer.h>
#include <openssl/x509.h>
+#ifndef NO_ASN1_OLD
+
int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
unsigned char *md, unsigned int *len)
{
int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
unsigned char *md, unsigned int *len)
{
- EVP_MD_CTX ctx;
int i;
unsigned char *str,*p;
int i;
unsigned char *str,*p;
@@
-81,27
+82,24
@@
int ASN1_digest(int (*i2d)(), const EVP_MD *type, char *data,
p=str;
i2d(data,&p);
p=str;
i2d(data,&p);
- EVP_DigestInit(&ctx,type);
- EVP_DigestUpdate(&ctx,str,i);
- EVP_DigestFinal(&ctx,md,len);
+ EVP_Digest(str, i, md, len, type, NULL);
OPENSSL_free(str);
return(1);
}
OPENSSL_free(str);
return(1);
}
+#endif
+
int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn,
unsigned char *md, unsigned int *len)
{
int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn,
unsigned char *md, unsigned int *len)
{
- EVP_MD_CTX ctx;
int i;
unsigned char *str = NULL;
i=ASN1_item_i2d(asn,&str, it);
if (!str) return(0);
int i;
unsigned char *str = NULL;
i=ASN1_item_i2d(asn,&str, it);
if (!str) return(0);
- EVP_DigestInit(&ctx,type);
- EVP_DigestUpdate(&ctx,str,i);
- EVP_DigestFinal(&ctx,md,len);
+ EVP_Digest(str, i, md, len, type, NULL);
OPENSSL_free(str);
return(1);
}
OPENSSL_free(str);
return(1);
}