diff options
Diffstat (limited to 'authfd.c')
-rw-r--r-- | authfd.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: authfd.c,v 1.111 2018/07/09 21:59:10 markus Exp $ */ | 1 | /* $OpenBSD: authfd.c,v 1.113 2018/12/27 23:02:11 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -94,7 +94,7 @@ ssh_get_authentication_socket(int *fdp) | |||
94 | *fdp = -1; | 94 | *fdp = -1; |
95 | 95 | ||
96 | authsocket = getenv(SSH_AUTHSOCKET_ENV_NAME); | 96 | authsocket = getenv(SSH_AUTHSOCKET_ENV_NAME); |
97 | if (!authsocket) | 97 | if (authsocket == NULL || *authsocket == '\0') |
98 | return SSH_ERR_AGENT_NOT_PRESENT; | 98 | return SSH_ERR_AGENT_NOT_PRESENT; |
99 | 99 | ||
100 | memset(&sunaddr, 0, sizeof(sunaddr)); | 100 | memset(&sunaddr, 0, sizeof(sunaddr)); |
@@ -327,10 +327,12 @@ ssh_free_identitylist(struct ssh_identitylist *idl) | |||
327 | static u_int | 327 | static u_int |
328 | agent_encode_alg(const struct sshkey *key, const char *alg) | 328 | agent_encode_alg(const struct sshkey *key, const char *alg) |
329 | { | 329 | { |
330 | if (alg != NULL && key->type == KEY_RSA) { | 330 | if (alg != NULL && sshkey_type_plain(key->type) == KEY_RSA) { |
331 | if (strcmp(alg, "rsa-sha2-256") == 0) | 331 | if (strcmp(alg, "rsa-sha2-256") == 0 || |
332 | strcmp(alg, "rsa-sha2-256-cert-v01@openssh.com") == 0) | ||
332 | return SSH_AGENT_RSA_SHA2_256; | 333 | return SSH_AGENT_RSA_SHA2_256; |
333 | else if (strcmp(alg, "rsa-sha2-512") == 0) | 334 | if (strcmp(alg, "rsa-sha2-512") == 0 || |
335 | strcmp(alg, "rsa-sha2-512-cert-v01@openssh.com") == 0) | ||
334 | return SSH_AGENT_RSA_SHA2_512; | 336 | return SSH_AGENT_RSA_SHA2_512; |
335 | } | 337 | } |
336 | return 0; | 338 | return 0; |