mirror of
https://github.com/yuzu-emu/mbedtls
synced 2024-11-24 07:18:08 +00:00
Clarify code-paths in x509write_csr and x509write_crt
This commit is contained in:
parent
a20e33ad59
commit
d8a6f7cfbe
2 changed files with 2 additions and 2 deletions
|
@ -321,7 +321,7 @@ int mbedtls_x509write_crt_der( mbedtls_x509write_cert *ctx, unsigned char *buf,
|
||||||
else if( mbedtls_pk_can_do( ctx->issuer_key, MBEDTLS_PK_ECDSA ) )
|
else if( mbedtls_pk_can_do( ctx->issuer_key, MBEDTLS_PK_ECDSA ) )
|
||||||
pk_alg = MBEDTLS_PK_ECDSA;
|
pk_alg = MBEDTLS_PK_ECDSA;
|
||||||
else
|
else
|
||||||
pk_alg = MBEDTLS_PK_NONE;
|
return( MBEDTLS_ERR_X509_INVALID_ALG );
|
||||||
|
|
||||||
if( ( ret = mbedtls_oid_get_oid_by_sig_alg( pk_alg, ctx->md_alg,
|
if( ( ret = mbedtls_oid_get_oid_by_sig_alg( pk_alg, ctx->md_alg,
|
||||||
&sig_oid, &sig_oid_len ) ) != 0 )
|
&sig_oid, &sig_oid_len ) ) != 0 )
|
||||||
|
|
|
@ -205,7 +205,7 @@ int mbedtls_x509write_csr_der( mbedtls_x509write_csr *ctx, unsigned char *buf, s
|
||||||
else if( mbedtls_pk_can_do( ctx->key, MBEDTLS_PK_ECDSA ) )
|
else if( mbedtls_pk_can_do( ctx->key, MBEDTLS_PK_ECDSA ) )
|
||||||
pk_alg = MBEDTLS_PK_ECDSA;
|
pk_alg = MBEDTLS_PK_ECDSA;
|
||||||
else
|
else
|
||||||
pk_alg = MBEDTLS_PK_NONE;
|
return( MBEDTLS_ERR_X509_INVALID_ALG );
|
||||||
|
|
||||||
if( ( ret = mbedtls_oid_get_oid_by_sig_alg( pk_alg, ctx->md_alg,
|
if( ( ret = mbedtls_oid_get_oid_by_sig_alg( pk_alg, ctx->md_alg,
|
||||||
&sig_oid, &sig_oid_len ) ) != 0 )
|
&sig_oid, &sig_oid_len ) ) != 0 )
|
||||||
|
|
Loading…
Reference in a new issue