Merge pull request #4574 from masap/fix-asn1-integer-get

Fix invalid return value of ASN1_INTEGER_get()
This commit is contained in:
Sean Parkinson
2021-11-18 17:20:15 +10:00
committed by GitHub
2 changed files with 2 additions and 6 deletions

View File

@ -52994,10 +52994,8 @@ static WOLFSSL_BN_ULONG wolfSSL_BN_get_word_1(mp_int *mp) {
WOLFSSL_BN_ULONG ret = 0UL;
int digit_i;
for (digit_i = 0; digit_i < mp->used; ++digit_i) {
ret <<= (WOLFSSL_BN_ULONG)DIGIT_BIT;
ret |= (WOLFSSL_BN_ULONG)mp->dp[digit_i];
}
for (digit_i = 0; digit_i < mp->used; ++digit_i)
ret |= ((WOLFSSL_BN_ULONG)mp->dp[digit_i]) << (DIGIT_BIT * digit_i);
return ret;
#endif

View File

@ -48551,7 +48551,6 @@ static void test_wolfSSL_ASN1_INTEGER_get_set(void)
AssertIntEQ(ASN1_INTEGER_get(a), val);
ASN1_INTEGER_free(a);
#ifndef TIME_T_NOT_64BIT
/* int max (2147483647) */
a = ASN1_INTEGER_new();
val = 2147483647;
@ -48567,7 +48566,6 @@ static void test_wolfSSL_ASN1_INTEGER_get_set(void)
AssertIntEQ(ret, 1);
AssertIntEQ(ASN1_INTEGER_get(a), val);
ASN1_INTEGER_free(a);
#endif
printf(resultFmt, passed);
#endif