File 3043-ssh-Update-tests-for-move-of-Edward-curves-to-ssh_fi.patch of Package erlang

From 2e43d2ef4675dd2c47fabec9963d1ae733e07b0f Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Tue, 11 Feb 2020 13:30:48 +0100
Subject: [PATCH 03/10] ssh: Update tests for move of Edward curves to ssh_file

---
 lib/ssh/test/ssh_test_lib.erl | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lib/ssh/test/ssh_test_lib.erl b/lib/ssh/test/ssh_test_lib.erl
index 83481e6c33..50f63c4096 100644
--- a/lib/ssh/test/ssh_test_lib.erl
+++ b/lib/ssh/test/ssh_test_lib.erl
@@ -432,7 +432,7 @@ setup_eddsa(Alg, DataDir, UserDir) ->
     file:copy(filename:join(DataDir, HostPub), filename:join(System, HostPub)),
 ct:log("DataDir ~p:~n ~p~n~nSystDir ~p:~n ~p~n~nUserDir ~p:~n ~p",[DataDir, file:list_dir(DataDir), System, file:list_dir(System), UserDir, file:list_dir(UserDir)]),
     setup_eddsa_known_host(HostPub, DataDir, UserDir),
-    setup_eddsa_auth_keys(IdPriv, DataDir, UserDir).
+    setup_eddsa_auth_keys(Alg, DataDir, UserDir).
 
 clean_dsa(UserDir) ->
     del_dirs(filename:join(UserDir, "system")),
@@ -572,9 +572,12 @@ setup_ecdsa_auth_keys(Size, Dir, UserDir) ->
     PKey = #'ECPoint'{point = Q},
     setup_auth_keys([{ {PKey,Param}, [{comment, "Test"}]}], UserDir).
 
-setup_eddsa_auth_keys(IdPriv, Dir, UserDir) ->
-    {ok, Pem} = file:read_file(filename:join(Dir, IdPriv)),
-    {ed_pri, Alg, Pub, _} = public_key:pem_entry_decode(hd(public_key:pem_decode(Pem))),
+setup_eddsa_auth_keys(Alg, Dir, UserDir) ->
+    SshAlg = case Alg of
+                 ed25519 -> 'ssh-ed25519';
+                 ed448 -> 'ssh-ed448'
+             end,
+    {ok, {ed_pri,Alg,Pub,_}} = ssh_file:user_key(SshAlg, [{user_dir,Dir}]),
     setup_auth_keys([{{ed_pub,Alg,Pub}, [{comment, "Test"}]}], UserDir).
 
 setup_auth_keys(Keys, Dir) ->
-- 
2.16.4

openSUSE Build Service is sponsored by