librb: mbedtls: fix rb_get_ssl_certfp()
Add missing break statements. Return the hash length on success.
This commit is contained in:
parent
bf3bcbb5b2
commit
7da82465a8
1 changed files with 4 additions and 1 deletions
|
@ -551,12 +551,15 @@ rb_get_ssl_certfp(rb_fde_t *F, uint8_t certfp[RB_SSL_CERTFP_LEN], int method)
|
||||||
case RB_SSL_CERTFP_METH_SHA1:
|
case RB_SSL_CERTFP_METH_SHA1:
|
||||||
md_type = MBEDTLS_MD_SHA1;
|
md_type = MBEDTLS_MD_SHA1;
|
||||||
hashlen = RB_SSL_CERTFP_LEN_SHA1;
|
hashlen = RB_SSL_CERTFP_LEN_SHA1;
|
||||||
|
break;
|
||||||
case RB_SSL_CERTFP_METH_SHA256:
|
case RB_SSL_CERTFP_METH_SHA256:
|
||||||
md_type = MBEDTLS_MD_SHA256;
|
md_type = MBEDTLS_MD_SHA256;
|
||||||
hashlen = RB_SSL_CERTFP_LEN_SHA256;
|
hashlen = RB_SSL_CERTFP_LEN_SHA256;
|
||||||
|
break;
|
||||||
case RB_SSL_CERTFP_METH_SHA512:
|
case RB_SSL_CERTFP_METH_SHA512:
|
||||||
md_type = MBEDTLS_MD_SHA512;
|
md_type = MBEDTLS_MD_SHA512;
|
||||||
hashlen = RB_SSL_CERTFP_LEN_SHA512;
|
hashlen = RB_SSL_CERTFP_LEN_SHA512;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -577,7 +580,7 @@ rb_get_ssl_certfp(rb_fde_t *F, uint8_t certfp[RB_SSL_CERTFP_LEN], int method)
|
||||||
|
|
||||||
memcpy(certfp, hash, hashlen);
|
memcpy(certfp, hash, hashlen);
|
||||||
|
|
||||||
return 1;
|
return hashlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in a new issue