summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/hx509/ca.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-09-20 23:18:34 -0700
committerAndrew Bartlett <abartlet@samba.org>2009-11-13 23:19:05 +1100
commit5bc87c14a1f5b45ed86e7ff9663f5f0aa2f70094 (patch)
tree82c3416f2211df07d5fe1e58ee6639f09e465a60 /source4/heimdal/lib/hx509/ca.c
parent12205347163b55e79651921c6858c4d04e1faa51 (diff)
downloadsamba-5bc87c14a1f5b45ed86e7ff9663f5f0aa2f70094.tar.gz
samba-5bc87c14a1f5b45ed86e7ff9663f5f0aa2f70094.tar.bz2
samba-5bc87c14a1f5b45ed86e7ff9663f5f0aa2f70094.zip
s4:heimdal: import lorikeet-heimdal-200909210500 (commit 290db8d23647a27c39b97c189a0b2ef6ec21ca69)
Diffstat (limited to 'source4/heimdal/lib/hx509/ca.c')
-rw-r--r--source4/heimdal/lib/hx509/ca.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source4/heimdal/lib/hx509/ca.c b/source4/heimdal/lib/hx509/ca.c
index 95f206f195..552a869809 100644
--- a/source4/heimdal/lib/hx509/ca.c
+++ b/source4/heimdal/lib/hx509/ca.c
@@ -1193,12 +1193,14 @@ ca_sign(hx509_context context,
unsigned char hash[SHA_DIGEST_LENGTH];
{
- SHA_CTX m;
-
- SHA1_Init(&m);
- SHA1_Update(&m, tbs->spki.subjectPublicKey.data,
- tbs->spki.subjectPublicKey.length / 8);
- SHA1_Final (hash, &m);
+ EVP_MD_CTX *ctx;
+
+ ctx = EVP_MD_CTX_create();
+ EVP_DigestInit_ex(ctx, EVP_sha1(), NULL);
+ EVP_DigestUpdate(ctx, tbs->spki.subjectPublicKey.data,
+ tbs->spki.subjectPublicKey.length / 8);
+ EVP_DigestFinal_ex(ctx, hash, NULL);
+ EVP_MD_CTX_destroy(ctx);
}
si.data = hash;