summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-08-08 15:09:43 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-08-08 15:17:35 +0200
commit6f996ff7a7140d8712bc780fad81b7372aac3b7c (patch)
tree704b84567d3b76b4b84f00bad9f4bc0313ab696a
parent53ed974a14500543ef86697e1b832529db028b27 (diff)
downloadgnutls-tmp-oss-fuzz-fixes.tar.gz
pkcs7,12: made type conversions explicittmp-oss-fuzz-fixes
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r--lib/x509/pkcs12.c4
-rw-r--r--lib/x509/pkcs7.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/x509/pkcs12.c b/lib/x509/pkcs12.c
index 2b7b8d6402..a985d69386 100644
--- a/lib/x509/pkcs12.c
+++ b/lib/x509/pkcs12.c
@@ -1038,7 +1038,7 @@ int gnutls_pkcs12_verify_mac(gnutls_pkcs12_t pkcs12, const char *pass)
return _gnutls_asn2err(result);
}
- algo = gnutls_oid_to_digest(oid);
+ algo = gnutls_oid_to_mac(oid);
if (algo == GNUTLS_MAC_UNKNOWN) {
unknown_mac:
gnutls_assert();
@@ -1880,7 +1880,7 @@ gnutls_pkcs12_mac_info(gnutls_pkcs12_t pkcs12, unsigned int *mac,
*oid = (char*)tmp.data;
}
- algo = gnutls_oid_to_digest((char*)tmp.data);
+ algo = gnutls_oid_to_mac((char*)tmp.data);
if (algo == GNUTLS_MAC_UNKNOWN || mac_to_entry(algo) == NULL) {
gnutls_assert();
return GNUTLS_E_UNKNOWN_HASH_ALGORITHM;
diff --git a/lib/x509/pkcs7.c b/lib/x509/pkcs7.c
index 955cb5ae9c..90e0702207 100644
--- a/lib/x509/pkcs7.c
+++ b/lib/x509/pkcs7.c
@@ -2283,7 +2283,7 @@ static int write_attributes(ASN1_TYPE c2, const char *root,
/* If we add any attribute we should add them all */
/* Add hash */
digest_size = _gnutls_hash_get_algo_len(me);
- ret = gnutls_hash_fast(me->id, data->data, data->size, digest);
+ ret = gnutls_hash_fast((gnutls_digest_algorithm_t)me->id, data->data, data->size, digest);
if (ret < 0) {
gnutls_assert();
return ret;