diff options
author | Ingela Anderton Andin <[email protected]> | 2019-04-09 17:51:18 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2019-04-12 10:25:36 +0200 |
commit | faeda00c1cea2e62f88493a3fe830730a58e72d2 (patch) | |
tree | b837eb54537d072633b54ad34763f0b9a5ae1b3e /lib/ssl/src/ssl_logger.erl | |
parent | 884239f1e06886b539960fb9cebf4ec1019939bd (diff) | |
download | otp-faeda00c1cea2e62f88493a3fe830730a58e72d2.tar.gz otp-faeda00c1cea2e62f88493a3fe830730a58e72d2.tar.bz2 otp-faeda00c1cea2e62f88493a3fe830730a58e72d2.zip |
ssl: Add functions to convert between diffrent cipher suite formats
Diffstat (limited to 'lib/ssl/src/ssl_logger.erl')
-rw-r--r-- | lib/ssl/src/ssl_logger.erl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/ssl/src/ssl_logger.erl b/lib/ssl/src/ssl_logger.erl index f497315235..987693b96b 100644 --- a/lib/ssl/src/ssl_logger.erl +++ b/lib/ssl/src/ssl_logger.erl @@ -206,10 +206,14 @@ parse_handshake(Direction, #encrypted_extensions{} = EncryptedExtensions) -> parse_cipher_suites([_|_] = Ciphers) -> [format_cipher(C) || C <- Ciphers]. -format_cipher(?TLS_EMPTY_RENEGOTIATION_INFO_SCSV) -> - 'TLS_EMPTY_RENEGOTIATION_INFO_SCSV'; format_cipher(C0) -> - list_to_atom(ssl_cipher_format:openssl_suite_name(C0)). + try ssl_cipher_format:suite_bin_to_map(C0) of + Map -> + ssl_cipher_format:suite_map_to_str(Map) + catch + error:function_clause -> + format_uknown_cipher_suite(C0) + end. get_client_version(Version, Extensions) -> CHVersions = maps:get(client_hello_versions, Extensions, undefined), @@ -436,3 +440,7 @@ number_to_hex(N) -> H -> lists:reverse(H) end. + +format_uknown_cipher_suite(<<?BYTE(X), ?BYTE(Y)>>) -> + "0x" ++ number_to_hex(X) ++ "0x" ++ number_to_hex(Y). + |