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
Function bootutil_verify_sig() indirectly calls pss_mgf1()
This function has sequence:
while (count>0) {
bootutil_sha_init(&ctx); // !!! Called many timesbootutil_sha_update(&ctx, hash, PSS_HLEN);
bootutil_sha_update(&ctx, counter, 4);
bootutil_sha_finish(&ctx, htmp);
...
}
bootutil_sha_drop(&ctx); // !!! called only once
For mynewt alternate implementation of hash requires only one bootutil_sha_init() for each bootutil_sha_drop().
Fix would be to put bootutil_sha_drop() just after bootutil_sha_finish() is called.
I'm not sure if moving call to bootutil_sha_drop() few lines about is acceptable or
mynewt code should handle such case on its own.
Function
bootutil_verify_sig()
indirectly callspss_mgf1()
This function has sequence:
For mynewt alternate implementation of hash requires only one
bootutil_sha_init()
for eachbootutil_sha_drop()
.Fix would be to put
bootutil_sha_drop()
just afterbootutil_sha_finish()
is called.I'm not sure if moving call to
bootutil_sha_drop()
few lines about is acceptable ormynewt code should handle such case on its own.
@utzig what is your opinion on that?
The text was updated successfully, but these errors were encountered: