summaryrefslogtreecommitdiff
path: root/lib/x509/mpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/x509/mpi.c')
-rw-r--r--lib/x509/mpi.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/x509/mpi.c b/lib/x509/mpi.c
index 2c301d321d..20a64690a3 100644
--- a/lib/x509/mpi.c
+++ b/lib/x509/mpi.c
@@ -284,10 +284,14 @@ static int write_oid_and_params(ASN1_TYPE dst, const char *dst_name, const char
int result;
char name[128];
+ if (params == NULL) {
+ gnutls_assert();
+ return GNUTLS_E_INVALID_REQUEST;
+ }
+
_gnutls_str_cpy(name, sizeof(name), dst_name);
_gnutls_str_cat(name, sizeof(name), ".algorithm");
-
/* write the OID.
*/
result = asn1_write_value(dst, name, oid, 1);
@@ -305,11 +309,6 @@ static int write_oid_and_params(ASN1_TYPE dst, const char *dst_name, const char
else if (params->pk == GNUTLS_PK_RSA_PSS) {
gnutls_datum_t tmp = { NULL, 0 };
- if (params == NULL) {
- gnutls_assert();
- return GNUTLS_E_INVALID_REQUEST;
- }
-
result = _gnutls_x509_write_rsa_pss_params(params, &tmp);
if (result < 0)
return gnutls_assert_val(result);