bcrypt: Make DH blob size validation more strict in key_import_pair().
This commit is contained in:
parent
4becbefe5d
commit
3ef933c08f
1 changed files with 2 additions and 2 deletions
|
@ -1929,7 +1929,7 @@ static NTSTATUS key_import_pair( struct algorithm *alg, const WCHAR *type, BCRYP
|
|||
{
|
||||
BCRYPT_DH_KEY_BLOB *dh_blob = (BCRYPT_DH_KEY_BLOB *)input;
|
||||
|
||||
if (input_len < sizeof(*dh_blob)) return STATUS_INVALID_PARAMETER;
|
||||
if (input_len != sizeof(*dh_blob) + dh_blob->cbKey * 4) return STATUS_INVALID_PARAMETER;
|
||||
if (alg->id != ALG_ID_DH || dh_blob->dwMagic != BCRYPT_DH_PRIVATE_MAGIC)
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
|
||||
|
@ -1948,7 +1948,7 @@ static NTSTATUS key_import_pair( struct algorithm *alg, const WCHAR *type, BCRYP
|
|||
{
|
||||
BCRYPT_DH_KEY_BLOB *dh_blob = (BCRYPT_DH_KEY_BLOB *)input;
|
||||
|
||||
if (input_len < sizeof(*dh_blob)) return STATUS_INVALID_PARAMETER;
|
||||
if (input_len != sizeof(*dh_blob) + dh_blob->cbKey * 3) return STATUS_INVALID_PARAMETER;
|
||||
if (alg->id != ALG_ID_DH || dh_blob->dwMagic != BCRYPT_DH_PUBLIC_MAGIC)
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue