FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/asn.c
/* Check To see if PKCS v2 algo is supported, set id if it is return 0
   < 0 on error */
Check To see if PKCS v2 algo is supported, set id if it is return 0
< 0 on error
Check To see if PKCS v2 algo is supported set id if it is return 0 < 0 on error
static int CheckAlgoV2(int oid, int* id, int* blockSz)
{
    if (blockSz) *blockSz = 8; 
    (void)id; 
    switch (oid) {
#if !defined(NO_DES3) && !defined(NO_SHA)
    case DESb:
        *id = PBE_SHA1_DES;
        if (blockSz) *blockSz = DES_BLOCK_SIZE;
        return 0;
    case DES3b:
        *id = PBE_SHA1_DES3;
        if (blockSz) *blockSz = DES_BLOCK_SIZE;
        return 0;
#endif
#ifdef WOLFSSL_AES_256
    case AES256CBCb:
        *id = PBE_AES256_CBC;
        if (blockSz) *blockSz = AES_BLOCK_SIZE;
        return 0;
#endif
#ifdef WOLFSSL_AES_128
    case AES128CBCb:
        *id = PBE_AES128_CBC;
        if (blockSz) *blockSz = AES_BLOCK_SIZE;
        return 0;
#endif
    default:
        WOLFSSL_MSG("No PKCS v2 algo found");
        return ALGO_ID_E;
    }
}
static int CheckAlgoV2 ( int oid , int * id , int * blockSz ) { if ( blockSz ) * blockSz = 8 ; ( void ) id ; switch ( oid ) { #if ! defined ( NO_DES3 ) && ! defined ( NO_SHA ) case DESb : * id = PBE_SHA1_DES ; if ( blockSz ) * blockSz = DES_BLOCK_SIZE ; return 0 ; case DES3b : * id = PBE_SHA1_DES3 ; if ( blockSz ) * blockSz = DES_BLOCK_SIZE ; return 0 ; #endif #ifdef WOLFSSL_AES_256 case AES256CBCb : * id = PBE_AES256_CBC ; if ( blockSz ) * blockSz = AES_BLOCK_SIZE ; return 0 ; #endif #ifdef WOLFSSL_AES_128 case AES128CBCb : * id = PBE_AES128_CBC ; if ( blockSz ) * blockSz = AES_BLOCK_SIZE ; return 0 ; #endif default : WOLFSSL_MSG ( " " ) ; return ALGO_ID_E ; } }
Check To see if PKCS v2 algo is supported, set id if it is return 0
< 0 on error
Check To see if PKCS v2 algo is supported set id if it is return 0 < 0 on error
/* default */ /* not used if AES and DES3 disabled */