diff options
author | Ed Maste <emaste@FreeBSD.org> | 2020-02-14 19:47:15 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2020-02-14 19:47:15 +0000 |
commit | f02e39982452024dafcf0ea6e536ebff586ffce4 (patch) | |
tree | 78cdaad953cc879dc7d97272436a4d84b228d94c /authfd.c | |
parent | dc9e8d9c8401178683a1f53bc816389a1160dc41 (diff) | |
download | src-f02e39982452024dafcf0ea6e536ebff586ffce4.tar.gz src-f02e39982452024dafcf0ea6e536ebff586ffce4.zip |
Vendor import of OpenSSH 8.0p1.vendor/openssh/8.0p1
Notes
Notes:
svn path=/vendor-crypto/openssh/dist/; revision=357933
svn path=/vendor-crypto/openssh/8.0p1/; revision=357934; tag=vendor/openssh/8.0p1
Diffstat (limited to 'authfd.c')
-rw-r--r-- | authfd.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: authfd.c,v 1.111 2018/07/09 21:59:10 markus Exp $ */ +/* $OpenBSD: authfd.c,v 1.113 2018/12/27 23:02:11 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -94,7 +94,7 @@ ssh_get_authentication_socket(int *fdp) *fdp = -1; authsocket = getenv(SSH_AUTHSOCKET_ENV_NAME); - if (!authsocket) + if (authsocket == NULL || *authsocket == '\0') return SSH_ERR_AGENT_NOT_PRESENT; memset(&sunaddr, 0, sizeof(sunaddr)); @@ -327,10 +327,12 @@ ssh_free_identitylist(struct ssh_identitylist *idl) static u_int agent_encode_alg(const struct sshkey *key, const char *alg) { - if (alg != NULL && key->type == KEY_RSA) { - if (strcmp(alg, "rsa-sha2-256") == 0) + if (alg != NULL && sshkey_type_plain(key->type) == KEY_RSA) { + if (strcmp(alg, "rsa-sha2-256") == 0 || + strcmp(alg, "rsa-sha2-256-cert-v01@openssh.com") == 0) return SSH_AGENT_RSA_SHA2_256; - else if (strcmp(alg, "rsa-sha2-512") == 0) + if (strcmp(alg, "rsa-sha2-512") == 0 || + strcmp(alg, "rsa-sha2-512-cert-v01@openssh.com") == 0) return SSH_AGENT_RSA_SHA2_512; } return 0; |