File 2518-ssh-update-property-test-for-sign-algorithm.patch of Package erlang

From 0df70c244df12c0a0678b04401e891e4683d7f69 Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Wed, 10 May 2017 15:27:30 +0200
Subject: [PATCH 2/4] ssh: update property test for sign-algorithm

---
 lib/ssh/test/property_test/ssh_eqc_encode_decode.erl | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/ssh/test/property_test/ssh_eqc_encode_decode.erl b/lib/ssh/test/property_test/ssh_eqc_encode_decode.erl
index 410a9ea98..099518262 100644
--- a/lib/ssh/test/property_test/ssh_eqc_encode_decode.erl
+++ b/lib/ssh/test/property_test/ssh_eqc_encode_decode.erl
@@ -284,8 +284,18 @@ fix_asym(#ssh_msg_global_request{name=N} = M) -> M#ssh_msg_global_request{name =
 fix_asym(#ssh_msg_debug{message=D,language=L} = M) -> M#ssh_msg_debug{message = binary_to_list(D),
 								      language = binary_to_list(L)};
 fix_asym(#ssh_msg_kexinit{cookie=C} = M) -> M#ssh_msg_kexinit{cookie = <<C:128>>};
+
+fix_asym(#ssh_msg_kexdh_reply{public_host_key = Key} = M) -> M#ssh_msg_kexdh_reply{public_host_key = key_sigalg(Key)};
+fix_asym(#ssh_msg_kex_dh_gex_reply{public_host_key = Key} = M) -> M#ssh_msg_kex_dh_gex_reply{public_host_key = key_sigalg(Key)};
+fix_asym(#ssh_msg_kex_ecdh_reply{public_host_key = Key} = M) -> M#ssh_msg_kex_ecdh_reply{public_host_key = key_sigalg(Key)};
+
 fix_asym(M) -> M.
 
+%%% Keys now contains an sig-algorithm name
+key_sigalg(#'RSAPublicKey'{} = Key) -> {Key,'ssh-rsa'};
+key_sigalg({_, #'Dss-Parms'{}} = Key) -> {Key,'ssh-dss'};
+key_sigalg({#'ECPoint'{}, {namedCurve,OID}} = Key) -> {Key,"ecdsa-sha2-256"}.
+
 %%% Message codes 30 and 31 are overloaded depending on kex family so arrange the decoder
 %%% input as the test object does
 decode_state(<<30,_/binary>>=Msg, KexFam) -> <<KexFam/binary, Msg/binary>>;
-- 
2.13.0

openSUSE Build Service is sponsored by