summaryrefslogtreecommitdiff
path: root/trust/x509.c
diff options
context:
space:
mode:
Diffstat (limited to 'trust/x509.c')
-rw-r--r--trust/x509.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/trust/x509.c b/trust/x509.c
index f49be73..b93d26c 100644
--- a/trust/x509.c
+++ b/trust/x509.c
@@ -98,6 +98,7 @@ p11_x509_calc_keyid (node_asn *cert,
unsigned char *keyid)
{
int start, end;
+ size_t len;
int ret;
return_val_if_fail (cert != NULL, NULL);
@@ -108,7 +109,8 @@ p11_x509_calc_keyid (node_asn *cert,
return_val_if_fail (ret == ASN1_SUCCESS, false);
return_val_if_fail (end >= start, false);
- p11_digest_sha1 (keyid, (der + start), (end - start) + 1, NULL);
+ len = (end - start) + 1;
+ p11_digest_sha1 (keyid, (der + start), len, NULL);
return true;
}