Skip to content

Commit 3d7583e

Browse files
authored
Merge pull request #7684 from kojo1/pk-fix
Fix in pk.c
2 parents 22abd37 + 72b6074 commit 3d7583e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pk.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,7 +2704,7 @@ int SetRsaInternal(WOLFSSL_RSA* rsa)
27042704
}
27052705

27062706
/* Copy down d mod q-1 if available. */
2707-
if ((ret == 1) && (rsa->dmp1 != NULL) &&
2707+
if ((ret == 1) && (rsa->dmq1 != NULL) &&
27082708
(wolfssl_bn_get_value(rsa->dmq1, &key->dQ) != 1)) {
27092709
WOLFSSL_ERROR_MSG("rsa dQ key error");
27102710
ret = -1;
@@ -3564,7 +3564,7 @@ int wolfSSL_RSA_padding_add_PKCS1_PSS(WOLFSSL_RSA *rsa, unsigned char *em,
35643564
if (ret == 1) {
35653565
/* Get length of RSA key - encrypted message length. */
35663566
emLen = wolfSSL_RSA_size(rsa);
3567-
if (ret <= 0) {
3567+
if (emLen <= 0) {
35683568
WOLFSSL_ERROR_MSG("wolfSSL_RSA_size error");
35693569
ret = 0;
35703570
}
@@ -8730,7 +8730,7 @@ int wolfSSL_DH_compute_key(unsigned char* key, const WOLFSSL_BIGNUM* otherPub,
87308730
if (ret == 0) {
87318731
/* Get the public key into the array. */
87328732
pubSz = wolfSSL_BN_bn2bin(otherPub, pub);
8733-
if (privSz <= 0) {
8733+
if (pubSz <= 0) {
87348734
ret = -1;
87358735
}
87368736
}

0 commit comments

Comments
 (0)