librb mbedTLS: der_pubkey is used out of scope
This commit is contained in:
parent
3fc0499e77
commit
b29800911a
1 changed files with 1 additions and 1 deletions
|
@ -370,13 +370,13 @@ rb_make_certfp(const mbedtls_x509_crt *const peer_cert, uint8_t certfp[const RB_
|
||||||
int ret;
|
int ret;
|
||||||
void* data = peer_cert->raw.p;
|
void* data = peer_cert->raw.p;
|
||||||
size_t datalen = peer_cert->raw.len;
|
size_t datalen = peer_cert->raw.len;
|
||||||
|
unsigned char der_pubkey[8192];
|
||||||
|
|
||||||
if(spki)
|
if(spki)
|
||||||
{
|
{
|
||||||
// Compiler may complain about dropping const qualifier on the cast below
|
// Compiler may complain about dropping const qualifier on the cast below
|
||||||
// See <https://github.com/ARMmbed/mbedtls/issues/396> -- this is okay
|
// See <https://github.com/ARMmbed/mbedtls/issues/396> -- this is okay
|
||||||
|
|
||||||
unsigned char der_pubkey[8192];
|
|
||||||
if((ret = mbedtls_pk_write_pubkey_der((mbedtls_pk_context *)&peer_cert->pk,
|
if((ret = mbedtls_pk_write_pubkey_der((mbedtls_pk_context *)&peer_cert->pk,
|
||||||
der_pubkey, sizeof der_pubkey)) < 0)
|
der_pubkey, sizeof der_pubkey)) < 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue