FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/src/ocsp.c
/* Returns result of OCSP nonce comparison. Return values:
 *  1 - nonces are both present and equal
 *  2 - both nonces are absent
 *  3 - nonce only present in response
 * -1 - nonce only present in request
 *  0 - both nonces present and equal
 */
Returns result of OCSP nonce comparison.
Returns result of OCSP nonce comparison .
int wolfSSL_OCSP_check_nonce(OcspRequest* req, WOLFSSL_OCSP_BASICRESP* bs)
{
    byte* reqNonce = NULL;
    byte* rspNonce = NULL;
    int reqNonceSz = 0;
    int rspNonceSz = 0;
    WOLFSSL_ENTER("wolfSSL_OCSP_check_nonce");
    if (req != NULL) {
        reqNonce = req->nonce;
        reqNonceSz = req->nonceSz;
    }
    if (bs != NULL) {
        rspNonce = bs->nonce;
        rspNonceSz = bs->nonceSz;
    }
    if (reqNonce == NULL && rspNonce == NULL)
        return 2;
    if (reqNonce == NULL && rspNonce != NULL)
        return 3;
    if (reqNonce != NULL && rspNonce == NULL)
        return -1;
    if (reqNonceSz == rspNonceSz && reqNonce && rspNonce) {
        if (XMEMCMP(reqNonce, rspNonce, reqNonceSz) == 0)
            return 1;
    }
    return 0;
}
int wolfSSL_OCSP_check_nonce ( OcspRequest * req , WOLFSSL_OCSP_BASICRESP * bs ) { byte * reqNonce = NULL ; byte * rspNonce = NULL ; int reqNonceSz = 0 ; int rspNonceSz = 0 ; WOLFSSL_ENTER ( " " ) ; if ( req != NULL ) { reqNonce = req -> nonce ; reqNonceSz = req -> nonceSz ; } if ( bs != NULL ) { rspNonce = bs -> nonce ; rspNonceSz = bs -> nonceSz ; } if ( reqNonce == NULL && rspNonce == NULL ) return 2 ; if ( reqNonce == NULL && rspNonce != NULL ) return 3 ; if ( reqNonce != NULL && rspNonce == NULL ) return -1 ; if ( reqNonceSz == rspNonceSz && reqNonce && rspNonce ) { if ( XMEMCMP ( reqNonce , rspNonce , reqNonceSz ) == 0 ) return 1 ; } return 0 ; }
Returns result of OCSP nonce comparison.
Returns result of OCSP nonce comparison .
/* nonce absent in both req and rsp */ /* nonce present in rsp only */ /* nonce present in req only */ /* nonces are present and equal, return 1. Extra NULL check for fixing
        scan-build warning. */ /* nonces are present but not equal */