summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorbket <bket@cvs.openbsd.org>2020-06-27 13:39:10 +0000
committerbket <bket@cvs.openbsd.org>2020-06-27 13:39:10 +0000
commit4cfecbc2017b2fd255be596bcf9917901c0fc838 (patch)
tree61877cdfc303bc01716ccf9ca2f74a737d4a36be /usr.bin/ssh
parent49949693850fc1f3baa2dcaa93565e8cdd9f7270 (diff)
Replace TAILQ concatenation loops with TAILQ_CONCAT
OK djm@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/sshconnect2.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/usr.bin/ssh/sshconnect2.c b/usr.bin/ssh/sshconnect2.c
index 246f9e5a067..3a263ded2a4 100644
--- a/usr.bin/ssh/sshconnect2.c
+++ b/usr.bin/ssh/sshconnect2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.323 2020/06/05 03:24:16 djm Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.324 2020/06/27 13:39:09 bket Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -1664,10 +1664,7 @@ pubkey_prepare(Authctxt *authctxt)
}
ssh_free_identitylist(idlist);
/* append remaining agent keys */
- for (id = TAILQ_FIRST(&agent); id; id = TAILQ_FIRST(&agent)) {
- TAILQ_REMOVE(&agent, id, next);
- TAILQ_INSERT_TAIL(preferred, id, next);
- }
+ TAILQ_CONCAT(preferred, &agent, next);
authctxt->agent_fd = agent_fd;
}
/* Prefer PKCS11 keys that are explicitly listed */
@@ -1693,10 +1690,7 @@ pubkey_prepare(Authctxt *authctxt)
}
}
/* append remaining keys from the config file */
- for (id = TAILQ_FIRST(&files); id; id = TAILQ_FIRST(&files)) {
- TAILQ_REMOVE(&files, id, next);
- TAILQ_INSERT_TAIL(preferred, id, next);
- }
+ TAILQ_CONCAT(preferred, &files, next);
/* finally, filter by PubkeyAcceptedKeyTypes */
TAILQ_FOREACH_SAFE(id, preferred, next, id2) {
if (id->key != NULL && !key_type_allowed_by_config(id->key)) {