summaryrefslogtreecommitdiff
path: root/sshconnect2.c
diff options
context:
space:
mode:
authorbket@openbsd.org <bket@openbsd.org>2020-06-27 13:39:09 +0000
committerDamien Miller <djm@mindrot.org>2020-07-03 15:12:31 +1000
commite1c401109b61f7dbc199b5099933d579e7fc5dc9 (patch)
tree9d3afb26fdc72482e25b04377caaddec54e8f84e /sshconnect2.c
parent14beca57ac92d62830c42444c26ba861812dc837 (diff)
upstream: Replace TAILQ concatenation loops with TAILQ_CONCAT
OK djm@ OpenBSD-Commit-ID: 454b40e09a117ddb833794358970a65b14c431ef
Diffstat (limited to 'sshconnect2.c')
-rw-r--r--sshconnect2.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/sshconnect2.c b/sshconnect2.c
index 821af2150..74946da0d 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect2.c,v 1.323 2020/06/05 03:24:16 djm Exp $ */ 1/* $OpenBSD: sshconnect2.c,v 1.324 2020/06/27 13:39:09 bket Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2008 Damien Miller. All rights reserved. 4 * Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -1671,10 +1671,7 @@ pubkey_prepare(Authctxt *authctxt)
1671 } 1671 }
1672 ssh_free_identitylist(idlist); 1672 ssh_free_identitylist(idlist);
1673 /* append remaining agent keys */ 1673 /* append remaining agent keys */
1674 for (id = TAILQ_FIRST(&agent); id; id = TAILQ_FIRST(&agent)) { 1674 TAILQ_CONCAT(preferred, &agent, next);
1675 TAILQ_REMOVE(&agent, id, next);
1676 TAILQ_INSERT_TAIL(preferred, id, next);
1677 }
1678 authctxt->agent_fd = agent_fd; 1675 authctxt->agent_fd = agent_fd;
1679 } 1676 }
1680 /* Prefer PKCS11 keys that are explicitly listed */ 1677 /* Prefer PKCS11 keys that are explicitly listed */
@@ -1700,10 +1697,7 @@ pubkey_prepare(Authctxt *authctxt)
1700 } 1697 }
1701 } 1698 }
1702 /* append remaining keys from the config file */ 1699 /* append remaining keys from the config file */
1703 for (id = TAILQ_FIRST(&files); id; id = TAILQ_FIRST(&files)) { 1700 TAILQ_CONCAT(preferred, &files, next);
1704 TAILQ_REMOVE(&files, id, next);
1705 TAILQ_INSERT_TAIL(preferred, id, next);
1706 }
1707 /* finally, filter by PubkeyAcceptedKeyTypes */ 1701 /* finally, filter by PubkeyAcceptedKeyTypes */
1708 TAILQ_FOREACH_SAFE(id, preferred, next, id2) { 1702 TAILQ_FOREACH_SAFE(id, preferred, next, id2) {
1709 if (id->key != NULL && !key_type_allowed_by_config(id->key)) { 1703 if (id->key != NULL && !key_type_allowed_by_config(id->key)) {