aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2015-06-15 12:13:52 +0200
committerIngela Anderton Andin <[email protected]>2015-06-15 12:13:52 +0200
commit26ed9f0e4a23985b7a0fbf7d9a38142edaf5c1aa (patch)
treedf50037c0ce2212c4ce0262f8bc09e433a14a539 /lib/ssl
parent5fff9dcfdba8c99d2f57b6878713a7b0332180b7 (diff)
parent0b19d46eaa4e4cf40be51acca9760c8f969638f2 (diff)
downloadotp-26ed9f0e4a23985b7a0fbf7d9a38142edaf5c1aa.tar.gz
otp-26ed9f0e4a23985b7a0fbf7d9a38142edaf5c1aa.tar.bz2
otp-26ed9f0e4a23985b7a0fbf7d9a38142edaf5c1aa.zip
Merge branch 'ia/ssl/unknown-hash/OTP-12829'
* ia/ssl/unknown-hash/OTP-12829: ssl: Add unassigned values ssl: Do not crash on proprietary hash_sign algorithms
Diffstat (limited to 'lib/ssl')
-rw-r--r--lib/ssl/src/ssl_cipher.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl
index 8584e56d6c..47ee4d68fb 100644
--- a/lib/ssl/src/ssl_cipher.erl
+++ b/lib/ssl/src/ssl_cipher.erl
@@ -1573,7 +1573,9 @@ hash_algorithm(?SHA) -> sha;
hash_algorithm(?SHA224) -> sha224;
hash_algorithm(?SHA256) -> sha256;
hash_algorithm(?SHA384) -> sha384;
-hash_algorithm(?SHA512) -> sha512.
+hash_algorithm(?SHA512) -> sha512;
+hash_algorithm(Other) when is_integer(Other) andalso ((Other >= 7) and (Other =< 223)) -> unassigned;
+hash_algorithm(Other) when is_integer(Other) andalso ((Other >= 224) and (Other =< 255)) -> Other.
sign_algorithm(anon) -> ?ANON;
sign_algorithm(rsa) -> ?RSA;
@@ -1582,7 +1584,9 @@ sign_algorithm(ecdsa) -> ?ECDSA;
sign_algorithm(?ANON) -> anon;
sign_algorithm(?RSA) -> rsa;
sign_algorithm(?DSA) -> dsa;
-sign_algorithm(?ECDSA) -> ecdsa.
+sign_algorithm(?ECDSA) -> ecdsa;
+sign_algorithm(Other) when is_integer(Other) andalso ((Other >= 4) and (Other =< 223)) -> unassigned;
+sign_algorithm(Other) when is_integer(Other) andalso ((Other >= 224) and (Other =< 255)) -> Other.
hash_size(null) ->
0;