diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2017-01-31 12:33:47 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2017-01-31 12:33:47 +0000 |
| commit | 19ca85510bbe080af3faf5e9ae394608428ac953 (patch) | |
| tree | 117f9a26f0d949b937129ea841578bd2ba4390fa /ssh-rsa.c | |
| parent | ab4ec008e7abd1c8098428dbf9642c3685383045 (diff) | |
Diffstat (limited to 'ssh-rsa.c')
| -rw-r--r-- | ssh-rsa.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ssh-rsa.c b/ssh-rsa.c index a6db2a06b5d19..cde05df10143c 100644 --- a/ssh-rsa.c +++ b/ssh-rsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-rsa.c,v 1.59 2016/04/21 06:08:02 djm Exp $ */ +/* $OpenBSD: ssh-rsa.c,v 1.60 2016/09/12 23:39:34 djm Exp $ */ /* * Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org> * @@ -53,7 +53,8 @@ rsa_hash_alg_ident(int hash_alg) static int rsa_hash_alg_from_ident(const char *ident) { - if (strcmp(ident, "ssh-rsa") == 0) + if (strcmp(ident, "ssh-rsa") == 0 || + strcmp(ident, "ssh-rsa-cert-v01@openssh.com") == 0) return SSH_DIGEST_SHA1; if (strcmp(ident, "rsa-sha2-256") == 0) return SSH_DIGEST_SHA256; @@ -93,8 +94,7 @@ ssh_rsa_sign(const struct sshkey *key, u_char **sigp, size_t *lenp, if (sigp != NULL) *sigp = NULL; - if (alg_ident == NULL || strlen(alg_ident) == 0 || - strncmp(alg_ident, "ssh-rsa-cert", strlen("ssh-rsa-cert")) == 0) + if (alg_ident == NULL || strlen(alg_ident) == 0) hash_alg = SSH_DIGEST_SHA1; else hash_alg = rsa_hash_alg_from_ident(alg_ident); |
