[openssl-users] Non const input for EVP_EncryptUpdate and EVP_DecryptUpdate

Edward Diener eldlistmailingz at tropicsoft.com
Wed Nov 22 14:42:15 UTC 2017


When calling EVP_EncryptUpdate with some plaintext to be encrypted the 
parameter for the plaintext is a pointer to a non-const array of 
unsigned char, as in the function prototype:

int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
          int *outl, unsigned char *in, int inl);

Similarly when calling EVP_DecryptUpdate with some ciphertext to be 
decrypted the parameter for the ciphertext is a pointer to a non-const 
array of unsigned char, as in the function prototype:

int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out,
          int *outl, unsigned char *in, int inl);

I have taken both these function prototypes from the OpenSSL 
documentation at
https://wiki.openssl.org/index.php/Manual:EVP_EncryptInit(3).

Does this mean that the input array in both cases actually is modified 
in any way by the functions ? Or is this just an error in that if the 
input remains unmodified the functions do not specify the parameter as 
'const unsigned char * in' instead ?




More information about the openssl-users mailing list