Remove `sig_oid` parameter from mbedtls_x509_sig_alg_gets()
The function `mbedtls_x509_sig_alg_gets()` previously needed the
raw ASN.1 OID string even though it is implicit in the PK and MD
parameters.
This commit modifies `mbedtls_x509_sig_alg_gets()` to infer the OID
and remove it from the parameters.
This will be needed for the new X.509 CRT structure which will
likely not store the signature OID.
Care has to be taken to handle the case of RSASSA-PSS correctly,
where the hash algorithm in the OID list is set to MBEDTLS_MD_NONE
because it's only determined by the algorithm parameters.
diff --git a/library/x509_crt.c b/library/x509_crt.c
index 9372998..f1f5473 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -1606,8 +1606,8 @@
ret = mbedtls_snprintf( p, n, "\n%ssigned using : ", prefix );
MBEDTLS_X509_SAFE_SNPRINTF;
- ret = mbedtls_x509_sig_alg_gets( p, n, &crt->sig_oid, crt->sig_pk,
- crt->sig_md, crt->sig_opts );
+ ret = mbedtls_x509_sig_alg_gets( p, n, sig_info.sig_pk,
+ sig_info.sig_md, sig_info.sig_opts );
MBEDTLS_X509_SAFE_SNPRINTF;
/* Key size */