Ignore:
Timestamp:
Jun 22, 2021, 9:00:19 PM (3 years ago)
Author:
coas-nagasima
Message:

WolfSSLとAzure IoT SDKを更新

Location:
azure_iot_hub_f767zi/trunk/wolfssl-4.7.0
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • azure_iot_hub_f767zi/trunk/wolfssl-4.7.0/wolfcrypt/src/hash.c

    r457 r464  
    3434#include <wolfssl/wolfcrypt/hash.h>
    3535#include <wolfssl/wolfcrypt/hmac.h>
     36#include <wolfssl/wolfcrypt/cryptocb.h>
    3637
    3738#ifdef NO_INLINE
     
    625626    int ret = HASH_TYPE_E; /* Default to hash type error */
    626627
    627     if (hash == NULL || data == NULL)
     628    if (hash == NULL || (data == NULL && dataSz > 0))
    628629        return BAD_FUNC_ARG;
    629630
     
    10271028        wc_Sha sha[1];
    10281029    #endif
     1030        int devId = INVALID_DEVID;
    10291031
    10301032    #ifdef WOLFSSL_SMALL_STACK
     
    10341036    #endif
    10351037
    1036         if ((ret = wc_InitSha(sha)) != 0) {
     1038    #ifdef WOLF_CRYPTO_CB
     1039        /* only use devId if its not an empty hash */
     1040        if (data != NULL && len > 0)
     1041            devId = wc_CryptoCb_GetDevIdAtIndex(0);
     1042    #endif
     1043
     1044        if ((ret = wc_InitSha_ex(sha, NULL, devId)) != 0) {
    10371045            WOLFSSL_MSG("InitSha failed");
    10381046        }
     
    11021110        wc_Sha256 sha256[1];
    11031111    #endif
     1112        int devId = INVALID_DEVID;
    11041113
    11051114    #ifdef WOLFSSL_SMALL_STACK
     
    11101119    #endif
    11111120
    1112         if ((ret = wc_InitSha256(sha256)) != 0) {
     1121    #ifdef WOLF_CRYPTO_CB
     1122        /* only use devId if its not an empty hash */
     1123        if (data != NULL && len > 0)
     1124            devId = wc_CryptoCb_GetDevIdAtIndex(0);
     1125    #endif
     1126
     1127        if ((ret = wc_InitSha256_ex(sha256, NULL, devId)) != 0) {
    11131128            WOLFSSL_MSG("InitSha256 failed");
    11141129        }
Note: See TracChangeset for help on using the changeset viewer.