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/hmac.c

    r457 r464  
    2525#endif
    2626
    27 #include <wolfssl/wolfcrypt/settings.h>
     27#include <wolfssl/wolfcrypt/wc_port.h>
    2828#include <wolfssl/wolfcrypt/error-crypt.h>
    2929
     
    10151015
    10161016    if (ret == 0)
    1017         ret  = wc_HmacInit(hmac, heap, devId);
     1017        ret = wc_HmacInit(hmac, heap, devId);
    10181018    if (ret == 0) {
    10191019        XMEMCPY(hmac->id, id, len);
    10201020        hmac->idLen = len;
     1021    }
     1022
     1023    return ret;
     1024}
     1025
     1026int wc_HmacInit_Label(Hmac* hmac, const char* label, void* heap, int devId)
     1027{
     1028    int ret = 0;
     1029    int labelLen = 0;
     1030
     1031    if (hmac == NULL || label == NULL)
     1032        ret = BAD_FUNC_ARG;
     1033    if (ret == 0) {
     1034        labelLen = (int)XSTRLEN(label);
     1035        if (labelLen == 0 || labelLen > HMAC_MAX_LABEL_LEN)
     1036            ret = BUFFER_E;
     1037    }
     1038
     1039    if (ret == 0)
     1040        ret  = wc_HmacInit(hmac, heap, devId);
     1041    if (ret == 0) {
     1042        XMEMCPY(hmac->label, label, labelLen);
     1043        hmac->labelLen = labelLen;
    10211044    }
    10221045
     
    12171240        byte   n = 0x1;
    12181241
     1242        /* RFC 5869 states that the length of output keying material in
     1243           octets must be L <= 255*HashLen or N = ceil(L/HashLen) */
     1244
     1245        if (out == NULL || ((outSz/hashSz) + ((outSz % hashSz) != 0)) > 255)
     1246            return BAD_FUNC_ARG;
     1247
    12191248        ret = wc_HmacInit(&myHmac, NULL, INVALID_DEVID);
    12201249        if (ret != 0)
    12211250            return ret;
     1251
    12221252
    12231253        while (outIdx < outSz) {
Note: See TracChangeset for help on using the changeset viewer.