bcrypt: Reject DH keys smaller than 512 bits.

This commit is contained in:
Hans Leidekker 2023-12-07 12:33:28 +01:00 committed by Alexandre Julliard
parent 3ef933c08f
commit 0d95ae4252

View file

@ -1210,6 +1210,8 @@ static NTSTATUS key_asymmetric_create( enum alg_id alg_id, ULONG bitlen, struct
return STATUS_NOT_IMPLEMENTED;
}
if (alg_id == ALG_ID_DH && bitlen < 512) return STATUS_INVALID_PARAMETER;
if (!(key = calloc( 1, sizeof(*key) ))) return STATUS_NO_MEMORY;
key->hdr.magic = MAGIC_KEY;
key->alg_id = alg_id;