diff options
author | Péter Dimitrov <[email protected]> | 2019-01-08 16:27:02 +0100 |
---|---|---|
committer | Péter Dimitrov <[email protected]> | 2019-01-08 16:27:02 +0100 |
commit | 225220030d58272e5e53290abcd93de860a1ebc8 (patch) | |
tree | 6bb72ac571d0ca9aa0071b43dff8ac2edc3166a6 /lib/ssl/src | |
parent | 92e8629ab97fe86c8a635e83db73c572331c1158 (diff) | |
parent | 754685293582e9998e23c7cd6010941ce690eae7 (diff) | |
download | otp-225220030d58272e5e53290abcd93de860a1ebc8.tar.gz otp-225220030d58272e5e53290abcd93de860a1ebc8.tar.bz2 otp-225220030d58272e5e53290abcd93de860a1ebc8.zip |
Merge branch 'peterdmv/ssl/fix-srp-encode-decode/ERL-790/OTP-15477' into maint
* peterdmv/ssl/fix-srp-encode-decode/ERL-790/OTP-15477:
ssl: Fix encoding/decoding of the SRP extension
Change-Id: Iee3276a60041a2c04c89385b2de2edb1cd81babd
Diffstat (limited to 'lib/ssl/src')
-rw-r--r-- | lib/ssl/src/ssl_handshake.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl index a50580e1ea..3da42eb8ac 100644 --- a/lib/ssl/src/ssl_handshake.erl +++ b/lib/ssl/src/ssl_handshake.erl @@ -610,7 +610,7 @@ encode_hello_extensions([#ec_point_formats{ec_point_format_list = ECPointFormats ?UINT16(Len), ?BYTE(ListLen), ECPointFormatList/binary, Acc/binary>>); encode_hello_extensions([#srp{username = UserName} | Rest], Acc) -> SRPLen = byte_size(UserName), - Len = SRPLen + 2, + Len = SRPLen + 1, encode_hello_extensions(Rest, <<?UINT16(?SRP_EXT), ?UINT16(Len), ?BYTE(SRPLen), UserName/binary, Acc/binary>>); encode_hello_extensions([#hash_sign_algos{hash_sign_algos = HashSignAlgos} | Rest], Acc) -> @@ -1933,7 +1933,7 @@ dec_hello_extensions(<<?UINT16(?RENEGOTIATION_EXT), ?UINT16(Len), Info:Len/binar RenegotiateInfo}}); dec_hello_extensions(<<?UINT16(?SRP_EXT), ?UINT16(Len), ?BYTE(SRPLen), SRP:SRPLen/binary, Rest/binary>>, Acc) - when Len == SRPLen + 2 -> + when Len == SRPLen + 1 -> dec_hello_extensions(Rest, Acc#hello_extensions{srp = #srp{username = SRP}}); dec_hello_extensions(<<?UINT16(?SIGNATURE_ALGORITHMS_EXT), ?UINT16(Len), |