aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_connection.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2010-09-08 07:42:09 +0200
committerIngela Anderton Andin <[email protected]>2010-09-08 07:42:09 +0200
commite058f26dabb1fa69dd691adac14bcfbe25a93e72 (patch)
tree047cd6126dce99394a9111dca2ebe51467369f6c /lib/ssl/src/ssl_connection.erl
parenta78b39a0e9ff2cfd13273ab077dc852d70565647 (diff)
parenta9b0039e971322b5ece78280e37df86b3ec0a843 (diff)
downloadotp-e058f26dabb1fa69dd691adac14bcfbe25a93e72.tar.gz
otp-e058f26dabb1fa69dd691adac14bcfbe25a93e72.tar.bz2
otp-e058f26dabb1fa69dd691adac14bcfbe25a93e72.zip
Merge branch 'ia/ssl-forgot-DH-params-DER' into dev
* ia/ssl-forgot-DH-params-DER: Add missed DER dh option.
Diffstat (limited to 'lib/ssl/src/ssl_connection.erl')
-rw-r--r--lib/ssl/src/ssl_connection.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index 7689976ff6..c94199c336 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -1034,7 +1034,7 @@ ssl_init(SslOpts, Role) ->
PrivateKey =
init_private_key(SslOpts#ssl_options.key, SslOpts#ssl_options.keyfile,
SslOpts#ssl_options.password, Role),
- DHParams = init_diffie_hellman(SslOpts#ssl_options.dhfile, Role),
+ DHParams = init_diffie_hellman(SslOpts#ssl_options.dh, SslOpts#ssl_options.dhfile, Role),
{ok, CertDbRef, CacheRef, OwnCert, PrivateKey, DHParams}.
@@ -1111,11 +1111,13 @@ file_error(Line, Error, Reason, File, Throw, Stack) ->
error_logger:error_report(Report),
throw(Throw).
-init_diffie_hellman(_, client) ->
+init_diffie_hellman(Params, _,_) when is_binary(Params)->
+ public_key:der_decode('DHParameter', Params);
+init_diffie_hellman(_,_, client) ->
undefined;
-init_diffie_hellman(undefined, _) ->
+init_diffie_hellman(_,undefined, _) ->
?DEFAULT_DIFFIE_HELLMAN_PARAMS;
-init_diffie_hellman(DHParamFile, server) ->
+init_diffie_hellman(_, DHParamFile, server) ->
try
{ok, List} = ssl_manager:cache_pem_file(DHParamFile),
case [Entry || Entry = {'DHParameter', _ , _} <- List] of