You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking through the example programs trying to get an idea of how to use the PK wrapper to abstract the RSA/EC functions, and think there are some issues with the pk_encrypt.c example program. This is probably low priority, but as an example program, it should be an example of proper use.
Specifically, the following code occurs at the exit label:
In some code paths, entropy is not yet initialized.
Similarly, the mbedtls_pk_context variable pk is never freed, even when it is initialized.
Two approaches to addressing these problems come immediately to mind:
init everything at the same time: ctr_drbg, entropy, and pk and then free them all at the same time (at the exit label), or
have three separate exit labels (e.g. exitA, exitB, exitC) and branch to whichever is appropriate at the point an error is encountered.
Description
Raised via Email by Brace Stout
Bug
OS
linux
mbed TLS build:
Version: development branch
I was looking through the example programs trying to get an idea of how to use the PK wrapper to abstract the RSA/EC functions, and think there are some issues with the pk_encrypt.c example program. This is probably low priority, but as an example program, it should be an example of proper use.
Specifically, the following code occurs at the exit label:
In some code paths, entropy is not yet initialized.
Similarly, the
mbedtls_pk_context
variablepk
is never freed, even when it is initialized.Two approaches to addressing these problems come immediately to mind:
ctr_drbg
,entropy
, andpk
and then free them all at the same time (at the exit label), orThe text was updated successfully, but these errors were encountered: