Re: AES and EVP_CIPHER question

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

 




> On May 17, 2022, at 4:32 AM, Matt Caswell <matt@xxxxxxxxxxx> wrote:
> 
> 
> 
> On 16/05/2022 23:48, Philip Prindeville wrote:
>> Sorry, I shouldn't have phrased that inartfully.
>> There is no EVP_CIPHER_CTX_get_padding(), so how does one achieve something analogous?
> 
> 
> From 3.0, assuming you are using provided ciphers (i.e. not engine ones), then OSSL_CIPHER_PARAM_PADDING is a "gettable" parameter. See the section "Gettable and Settable EVP_CIPHER_CTX parameters" on this page:
> 
> https://www.openssl.org/docs/man3.0/man3/EVP_EncryptInit_ex2.html
> 
> So you can use EVP_CIPHER_CTX_get_params() to obtain that value (documented on the same man page as above). E.g. something like:
> 
> OSSL_PARAM params[2], *p = params;
> unsigned int pad;
> 
> *p++ = OSSL_PARAM_construct_uint(OSSL_CIPHER_PARAM_PADDING,
>                                 &pad);
> *p = OSSL_PARAM_construct_end();
> 
> if (!EVP_CIPHER_CTX_get_params(ctx, params)) {
>    /* Error */
> }
> 
> Matt


Thanks, and for 1.1.x?






[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