diff options
author | Erlang/OTP <[email protected]> | 2018-11-09 17:51:28 +0100 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2018-11-09 17:51:28 +0100 |
commit | ef7d4b64ccb8228d65fefe66ed2db8dba4e71da4 (patch) | |
tree | 8b0b9d97193f47a2b97367bccba1e81b38002b40 /lib/ssl/src/ssl_handshake.erl | |
parent | cb86d6daabc6dc2af7d05fd1c5b44b1697bad926 (diff) | |
parent | 6d884ff0e5e4a7cce8973d6979f15bd925af15c5 (diff) | |
download | otp-ef7d4b64ccb8228d65fefe66ed2db8dba4e71da4.tar.gz otp-ef7d4b64ccb8228d65fefe66ed2db8dba4e71da4.tar.bz2 otp-ef7d4b64ccb8228d65fefe66ed2db8dba4e71da4.zip |
Merge branch 'ingela/maint-20/ssl/rsa-kex-engine/ERIERL-268/OTP-15420' into maint-20
* ingela/maint-20/ssl/rsa-kex-engine/ERIERL-268/OTP-15420:
ssl: Add engine handling clause to RSA key exchange
Diffstat (limited to 'lib/ssl/src/ssl_handshake.erl')
-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 |