Skip to content

Commit 2cba139

Browse files
Merged PR 6703946: SymCryptDlgroupSetValueSafePrime: Remove redundant pDlgroup check for NULL
Related work items: #37128890
2 parents a5bd660 + 347c4dd commit 2cba139

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
[submodule "jitterentropy-library"]
66
path = jitterentropy-library
77
url = https://github.com/smuellerDD/jitterentropy-library
8+
ignore = untracked

inc/symcrypt.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5220,8 +5220,6 @@ SymCryptDlgroupSetValueSafePrime(
52205220
// to 0 in allocation (equivalent to nBitsOfQ = (nBitsOfP-1)) when creating a safe-prime group.
52215221
//
52225222
// Requirements:
5223-
// - pDlgroup!=NULL. Otherwise it returns SYMCRYPT_INVALID_ARGUMENT.
5224-
//
52255223
// - pDlgroup was allocated with sufficient bits for the selected P (and Q) to fit. If there is no
52265224
// named safe-prime group with bit size <= the allocated size, it returns SYMCRYPT_INVALID_ARGUMENT.
52275225
// The minimum currently supported bitsize of named safe-prime groups is nBitsOfP = 2048.

lib/dlgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ SymCryptDlgroupSetValueSafePrime(
10971097
UINT32 nMaxBitsOfP = SYMCRYPT_MIN(pDlgroup->nMaxBitsOfP, pDlgroup->nMaxBitsOfQ+1);
10981098
UINT32 nMaxDigitsOfP;
10991099

1100-
if ( pDlgroup == NULL || dhSafePrimeType == SYMCRYPT_DLGROUP_DH_SAFEPRIMETYPE_NONE )
1100+
if ( dhSafePrimeType == SYMCRYPT_DLGROUP_DH_SAFEPRIMETYPE_NONE )
11011101
{
11021102
scError = SYMCRYPT_INVALID_ARGUMENT;
11031103
goto cleanup;

unittest/lib/main_sys_common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ scheduleAsyncTest( SelfTestFn f, BYTE rnd )
6868
{
6969
PKDPC pDpc;
7070

71-
pDpc = (PKDPC) ExAllocatePoolWithTag( NonPagedPoolNx, sizeof( KDPC ), 'TcCS' );
71+
pDpc = (PKDPC) ExAllocatePoolZero( NonPagedPoolNx, sizeof( KDPC ), 'TcCS' );
7272
if( pDpc == NULL )
7373
{
7474
return;

0 commit comments

Comments
 (0)