Opaque structures - Cant access buf_len variable from evp_cipher_ctx_st

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Good morning,

I'd like to know how to get buffer length from cipher structures since 1.1 version.

I'm using that variable member to know what should be the required length if something gets wrong and return to the caller. Snippet of my source code:

DecryptUpdate(unsigned char* pEncryptedPart, unsigned long int ulEncryptedPartLen,
unsigned char* pPart, unsigned long int *pulPartLen){

unsigned long required_rest = (ctx.buf_len + ulEncryptedPartLen) % EVP_CIPHER_block_size(mCipher);
unsigned long required_len = ctx.buf_len + ulEncryptedPartLen - required_rest;

if (pPart == NULL_PTR || *pulPartLen < required_len)
{
*pulPartLen = required_len;
return pPart == NULL_PTR  ? CKR_OK : CKR_BUFFER_TOO_SMALL;
}
...
}

--
Kind Regards,
Pedro Lopes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux