FreeRTOS-Plus/ThirdParty/WolfSSL-FIPS-Ready/wolfcrypt/src/asn.c
/* Remove Encrypted PKCS8 header, move beginning of traditional to beginning
   of input */
Remove Encrypted PKCS8 header, move beginning of traditional to beginning
of input
Remove Encrypted PKCS8 header move beginning of traditional to beginning of input
int ToTraditionalEnc(byte* input, word32 sz,const char* password,
                     int passwordSz, word32* algId)
{
    int ret, length;
    word32 inOutIdx = 0;
    if (GetSequence(input, &inOutIdx, &length, sz) < 0) {
        ret = ASN_PARSE_E;
    }
    else {
        ret = DecryptContent(input + inOutIdx, sz - inOutIdx, password,
                passwordSz);
        if (ret > 0) {
            XMEMMOVE(input, input + inOutIdx, ret);
            ret = ToTraditional_ex(input, ret, algId);
        }
    }
    return ret;
}
int ToTraditionalEnc ( byte * input , word32 sz , const char * password , int passwordSz , word32 * algId ) { int ret , length ; word32 inOutIdx = 0 ; if ( GetSequence ( input , & inOutIdx , & length , sz ) < 0 ) { ret = ASN_PARSE_E ; } else { ret = DecryptContent ( input + inOutIdx , sz - inOutIdx , password , passwordSz ) ; if ( ret > 0 ) { XMEMMOVE ( input , input + inOutIdx , ret ) ; ret = ToTraditional_ex ( input , ret , algId ) ; } } return ret ; }
Remove Encrypted PKCS8 header, move beginning of traditional to beginning
of input
Remove Encrypted PKCS8 header move beginning of traditional to beginning of input