src/wolfSSL/src/internal.c
static int HashOutput(WOLFSSL* ssl, const byte* output, int sz, int ivSz)
{
    const byte* adj = output + RECORD_HEADER_SZ + ivSz;
    sz -= RECORD_HEADER_SZ;

#ifdef HAVE_FUZZER
    if (ssl->fuzzerCb)
        ssl->fuzzerCb(ssl, output, sz, FUZZ_HASH, ssl->fuzzerCtx);
#endif
#ifdef WOLFSSL_DTLS
    if (ssl->options.dtls) {
        adj += DTLS_RECORD_EXTRA;
        sz  -= DTLS_RECORD_EXTRA;
    }
#endif
#ifndef NO_OLD_TLS
#ifndef NO_SHA
    wc_ShaUpdate(&ssl->hsHashes->hashSha, adj, sz);
#endif
#ifndef NO_MD5
    wc_Md5Update(&ssl->hsHashes->hashMd5, adj, sz);
#endif
#endif

    if (IsAtLeastTLSv1_2(ssl)) {
        int ret;

#ifndef NO_SHA256
        ret = wc_Sha256Update(&ssl->hsHashes->hashSha256, adj, sz);
        if (ret != 0)
            return ret;
#endif
#ifdef WOLFSSL_SHA384
        ret = wc_Sha384Update(&ssl->hsHashes->hashSha384, adj, sz);
        if (ret != 0)
            return ret;
#endif
#ifdef WOLFSSL_SHA512
        ret = wc_Sha512Update(&ssl->hsHashes->hashSha512, adj, sz);
        if (ret != 0)
            return ret;
#endif
    }

    return 0;
}
/* add output to md5 and sha handshake hashes, exclude record header */
add output to md5 and sha handshake hashes, exclude record header
add output to md5 and sha handshake hashes exclude record header
static int HashOutput(WOLFSSL* ssl, const byte* output, int sz, int ivSz)
{
    const byte* adj = output + RECORD_HEADER_SZ + ivSz;
    sz -= RECORD_HEADER_SZ;
#ifdef HAVE_FUZZER
    if (ssl->fuzzerCb)
        ssl->fuzzerCb(ssl, output, sz, FUZZ_HASH, ssl->fuzzerCtx);
#endif
#ifdef WOLFSSL_DTLS
    if (ssl->options.dtls) {
        adj += DTLS_RECORD_EXTRA;
        sz  -= DTLS_RECORD_EXTRA;
    }
#endif
#ifndef NO_OLD_TLS
#ifndef NO_SHA
    wc_ShaUpdate(&ssl->hsHashes->hashSha, adj, sz);
#endif
#ifndef NO_MD5
    wc_Md5Update(&ssl->hsHashes->hashMd5, adj, sz);
#endif
#endif
    if (IsAtLeastTLSv1_2(ssl)) {
        int ret;
#ifndef NO_SHA256
        ret = wc_Sha256Update(&ssl->hsHashes->hashSha256, adj, sz);
        if (ret != 0)
            return ret;
#endif
#ifdef WOLFSSL_SHA384
        ret = wc_Sha384Update(&ssl->hsHashes->hashSha384, adj, sz);
        if (ret != 0)
            return ret;
#endif
#ifdef WOLFSSL_SHA512
        ret = wc_Sha512Update(&ssl->hsHashes->hashSha512, adj, sz);
        if (ret != 0)
            return ret;
#endif
    }
    return 0;
}
static int HashOutput ( WOLFSSL * ssl , const byte * output , int sz , int ivSz ) { const byte * adj = output + RECORD_HEADER_SZ + ivSz ; sz -= RECORD_HEADER_SZ ; #ifdef HAVE_FUZZER if ( ssl -> fuzzerCb ) ssl -> fuzzerCb ( ssl , output , sz , FUZZ_HASH , ssl -> fuzzerCtx ) ; #endif #ifdef WOLFSSL_DTLS if ( ssl -> options . dtls ) { adj += DTLS_RECORD_EXTRA ; sz -= DTLS_RECORD_EXTRA ; } #endif #ifndef NO_OLD_TLS #ifndef NO_SHA wc_ShaUpdate ( & ssl -> hsHashes -> hashSha , adj , sz ) ; #endif #ifndef NO_MD5 wc_Md5Update ( & ssl -> hsHashes -> hashMd5 , adj , sz ) ; #endif #endif if ( IsAtLeastTLSv1_2 ( ssl ) ) { int ret ; #ifndef NO_SHA256 ret = wc_Sha256Update ( & ssl -> hsHashes -> hashSha256 , adj , sz ) ; if ( ret != 0 ) return ret ; #endif #ifdef WOLFSSL_SHA384 ret = wc_Sha384Update ( & ssl -> hsHashes -> hashSha384 , adj , sz ) ; if ( ret != 0 ) return ret ; #endif #ifdef WOLFSSL_SHA512 ret = wc_Sha512Update ( & ssl -> hsHashes -> hashSha512 , adj , sz ) ; if ( ret != 0 ) return ret ; #endif } return 0 ; }
add output to md5 and sha handshake hashes, exclude record header
add output to md5 and sha handshake hashes exclude record header