Browse Source

convert outLen type correctly

Hideki Miyazaki 2 tuần trước cách đây
mục cha
commit
d4b265e84c
2 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 3 3
      wolfcrypt/src/port/Renesas/renesas_common.c
  2. 2 2
      wolfcrypt/src/rsa.c

+ 3 - 3
wolfcrypt/src/port/Renesas/renesas_common.c

@@ -376,7 +376,7 @@ static int Renesas_cmn_CryptoDevCb(int devIdArg, wc_CryptoInfo* info, void* ctx)
                         ret = wc_fspsm_RsaFunction(info->pk.rsa.in,
                                         info->pk.rsa.inLen,
                                         info->pk.rsa.out,
-                                        (word32*)&info->pk.rsa.outLen,
+                                        info->pk.rsa.outLen,
                                         info->pk.rsa.type,
                                         info->pk.rsa.key,
                                         info->pk.rsa.rng);
@@ -385,7 +385,7 @@ static int Renesas_cmn_CryptoDevCb(int devIdArg, wc_CryptoInfo* info, void* ctx)
                    ret = wc_fspsm_RsaSign(info->pk.rsa.in,
                                         info->pk.rsa.inLen,
                                         info->pk.rsa.out,
-                                        (word32*)&info->pk.rsa.outLen,
+                                        info->pk.rsa.outLen,
                                         info->pk.rsa.key,
                                         (void*)ctx);
                 }
@@ -393,7 +393,7 @@ static int Renesas_cmn_CryptoDevCb(int devIdArg, wc_CryptoInfo* info, void* ctx)
                     ret = wc_fspsm_RsaVerify(info->pk.rsa.in,
                                         info->pk.rsa.inLen,
                                         info->pk.rsa.out,
-                                        (word32*)&info->pk.rsa.outLen,
+                                        info->pk.rsa.outLen,
                                         info->pk.rsa.key,
                                         (void*)ctx);
                 }

+ 2 - 2
wolfcrypt/src/rsa.c

@@ -3318,7 +3318,7 @@ static int RsaPublicEncryptEx(const byte* in, word32 inLen, byte* out,
             if (key->devId != INVALID_DEVID) {
                 /* SCE supports 1024 and 2048 bits */
                 ret = wc_CryptoCb_Rsa(in, inLen, out,
-                                    outLen, rsa_type, key, rng);
+                                    &outLen, rsa_type, key, rng);
                 if (ret != CRYPTOCB_UNAVAILABLE)
                     return ret;
                 /* fall-through when unavailable */
@@ -3475,7 +3475,7 @@ static int RsaPrivateDecryptEx(const byte* in, word32 inLen, byte* out,
            #ifdef WOLF_CRYPTO_CB
                 if (key->devId != INVALID_DEVID) {
                     ret = wc_CryptoCb_Rsa(in, inLen, out,
-                                        outLen, rsa_type, key, rng);
+                                        &outLen, rsa_type, key, rng);
                     if (ret != CRYPTOCB_UNAVAILABLE)
                       return ret;
                     /* fall-through when unavailable */