Merge pull request #9886 from philljj/fix_f_193

wc_encrypt: add missing ForceZero for Des, Arc4, Rc2.
pull/9765/head
Daniel Pouzzner 2026-03-09 23:43:26 -05:00 committed by GitHub
commit b02ddde4f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -518,6 +518,7 @@ int wc_CryptKey(const char* password, int passwordSz, byte* salt,
wc_Des_CbcDecrypt(&des, input, input, (word32)length);
}
}
ForceZero(&des, sizeof(Des));
break;
}
#endif /* !NO_SHA || !NO_MD5 */
@ -561,6 +562,7 @@ int wc_CryptKey(const char* password, int passwordSz, byte* salt,
wc_Arc4SetKey(&dec, key, derivedLen);
wc_Arc4Process(&dec, input, input, (word32)length);
ForceZero(&dec, sizeof(Arc4));
break;
}
#endif
@ -629,9 +631,7 @@ int wc_CryptKey(const char* password, int passwordSz, byte* salt,
else
ret = wc_Rc2CbcDecrypt(&rc2, input, input, length);
}
if (ret == 0) {
ForceZero(&rc2, sizeof(Rc2));
}
ForceZero(&rc2, sizeof(Rc2));
break;
}
#endif