summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2017-09-24 17:42:01 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-09-24 17:42:01 +0200
commit410a801ac3345c6ae8e732174989d9c2986faf36 (patch)
tree9be82084f4a8d1caf88e0a4be7297cdf48b70309
parent5fb83cf24ed06883d7f8f0e94726e07436ab86bf (diff)
downloadgnutls-410a801ac3345c6ae8e732174989d9c2986faf36.tar.gz
gnutls_x509_crt/q_set_spki: always initialize the spki structure
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-rw-r--r--lib/x509/crq.c3
-rw-r--r--lib/x509/x509_write.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/x509/crq.c b/lib/x509/crq.c
index 3c3a6d0a7b..ac58529f6f 100644
--- a/lib/x509/crq.c
+++ b/lib/x509/crq.c
@@ -3035,6 +3035,8 @@ gnutls_x509_crq_set_spki(gnutls_x509_crq_t crq,
goto cleanup;
}
+ memset(&tpki, 0, sizeof(gnutls_x509_spki_st));
+
if (crq_pk == GNUTLS_PK_RSA) {
const mac_entry_st *me;
@@ -3045,7 +3047,6 @@ gnutls_x509_crq_set_spki(gnutls_x509_crq_t crq,
goto cleanup;
}
- memset(&tpki, 0, sizeof(gnutls_x509_spki_st));
tpki.pk = spki->pk;
tpki.rsa_pss_dig = spki->rsa_pss_dig;
diff --git a/lib/x509/x509_write.c b/lib/x509/x509_write.c
index e4df604861..6d5ed6a52e 100644
--- a/lib/x509/x509_write.c
+++ b/lib/x509/x509_write.c
@@ -2063,6 +2063,8 @@ gnutls_x509_crt_set_spki(gnutls_x509_crt_t crt,
goto cleanup;
}
+ memset(&tpki, 0, sizeof(gnutls_x509_spki_st));
+
if (crt_pk == GNUTLS_PK_RSA) {
const mac_entry_st *me;
@@ -2073,7 +2075,6 @@ gnutls_x509_crt_set_spki(gnutls_x509_crt_t crt,
goto cleanup;
}
- memset(&tpki, 0, sizeof(gnutls_x509_spki_st));
tpki.pk = spki->pk;
tpki.rsa_pss_dig = spki->rsa_pss_dig;