summaryrefslogtreecommitdiff
path: root/ssh-rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-rsa.c')
-rw-r--r--ssh-rsa.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ssh-rsa.c b/ssh-rsa.c
index a6db2a06b..cde05df10 100644
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-rsa.c,v 1.59 2016/04/21 06:08:02 djm Exp $ */ 1/* $OpenBSD: ssh-rsa.c,v 1.60 2016/09/12 23:39:34 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org> 3 * Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org>
4 * 4 *
@@ -53,7 +53,8 @@ rsa_hash_alg_ident(int hash_alg)
53static int 53static int
54rsa_hash_alg_from_ident(const char *ident) 54rsa_hash_alg_from_ident(const char *ident)
55{ 55{
56 if (strcmp(ident, "ssh-rsa") == 0) 56 if (strcmp(ident, "ssh-rsa") == 0 ||
57 strcmp(ident, "ssh-rsa-cert-v01@openssh.com") == 0)
57 return SSH_DIGEST_SHA1; 58 return SSH_DIGEST_SHA1;
58 if (strcmp(ident, "rsa-sha2-256") == 0) 59 if (strcmp(ident, "rsa-sha2-256") == 0)
59 return SSH_DIGEST_SHA256; 60 return SSH_DIGEST_SHA256;
@@ -93,8 +94,7 @@ ssh_rsa_sign(const struct sshkey *key, u_char **sigp, size_t *lenp,
93 if (sigp != NULL) 94 if (sigp != NULL)
94 *sigp = NULL; 95 *sigp = NULL;
95 96
96 if (alg_ident == NULL || strlen(alg_ident) == 0 || 97 if (alg_ident == NULL || strlen(alg_ident) == 0)
97 strncmp(alg_ident, "ssh-rsa-cert", strlen("ssh-rsa-cert")) == 0)
98 hash_alg = SSH_DIGEST_SHA1; 98 hash_alg = SSH_DIGEST_SHA1;
99 else 99 else
100 hash_alg = rsa_hash_alg_from_ident(alg_ident); 100 hash_alg = rsa_hash_alg_from_ident(alg_ident);