diff options
author | Ingela Anderton Andin <[email protected]> | 2018-11-06 10:07:26 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2018-11-09 16:52:14 +0100 |
commit | 6d884ff0e5e4a7cce8973d6979f15bd925af15c5 (patch) | |
tree | 8b0b9d97193f47a2b97367bccba1e81b38002b40 /lib/ssl/src | |
parent | cb86d6daabc6dc2af7d05fd1c5b44b1697bad926 (diff) | |
download | otp-6d884ff0e5e4a7cce8973d6979f15bd925af15c5.tar.gz otp-6d884ff0e5e4a7cce8973d6979f15bd925af15c5.tar.bz2 otp-6d884ff0e5e4a7cce8973d6979f15bd925af15c5.zip |
ssl: Add engine handling clause to RSA key exchange
Diffstat (limited to 'lib/ssl/src')
-rw-r--r-- | lib/ssl/src/ssl_handshake.erl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl index cd601c04c0..c5a87e28bc 100644 --- a/lib/ssl/src/ssl_handshake.erl +++ b/lib/ssl/src/ssl_handshake.erl @@ -898,6 +898,13 @@ premaster_secret(EncSecret, #'RSAPrivateKey'{} = RSAPrivateKey) -> catch _:_ -> throw(?ALERT_REC(?FATAL, ?DECRYPT_ERROR)) + end; +premaster_secret(EncSecret, #{algorithm := rsa} = Engine) -> + try crypto:private_decrypt(rsa, EncSecret, maps:remove(algorithm, Engine), + [{rsa_pad, rsa_pkcs1_padding}]) + catch + _:_ -> + throw(?ALERT_REC(?FATAL, ?DECRYPT_ERROR)) end. %%==================================================================== %% Extensions handling |