DESERIALIZER: Implement decryption of password protected objects
authorRichard Levitte <levitte@openssl.org>
Fri, 10 Jul 2020 13:13:55 +0000 (15:13 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 24 Jul 2020 14:43:20 +0000 (16:43 +0200)
commit7524b7b748d5989f015bc4b9651be92dbcb375fd
treea860dbc13b45adda1883e6aedce99c24d21e722d
parent45396db0e3bfd796e89669baf3a3ecc9602d36d5
DESERIALIZER: Implement decryption of password protected objects

This implements these functions:

OSSL_DESERIALIZER_CTX_set_cipher()
OSSL_DESERIALIZER_CTX_set_passphrase()
OSSL_DESERIALIZER_CTX_set_passphrase_ui()
OSSL_DESERIALIZER_CTX_set_passphrase_cb()

To be able to deal with multiple deserializers trying to work on the
same byte array and wanting to decrypt it while doing so, the
deserializer caches the passphrase.  This cache is cleared at the end
of OSSL_DESERIALIZER_from_bio().

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12410)
crypto/serializer/build.info
crypto/serializer/deserializer_lib.c
crypto/serializer/deserializer_pkey.c
crypto/serializer/serdes_pass.c [new file with mode: 0644]
crypto/serializer/serializer_local.h
crypto/serializer/serializer_pkey.c
include/openssl/core_names.h