summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-rsa.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2010-04-16 01:47:25 +0000
committerdjm <djm@openbsd.org>2010-04-16 01:47:25 +0000
commitc3ded031a669caee89e4ee23e0ecd423f58e6370 (patch)
treef27d771cafedf0f8611b9fec535729f8b4765228 /usr.bin/ssh/ssh-rsa.c
parentif there is no raid, do not allocate a 0-sized structure for sensors (diff)
downloadwireguard-openbsd-c3ded031a669caee89e4ee23e0ecd423f58e6370.tar.xz
wireguard-openbsd-c3ded031a669caee89e4ee23e0ecd423f58e6370.zip
revised certificate format ssh-{dss,rsa}-cert-v01@openssh.com with the
following changes: move the nonce field to the beginning of the certificate where it can better protect against chosen-prefix attacks on the signature hash Rename "constraints" field to "critical options" Add a new non-critical "extensions" field Add a serial number The older format is still support for authentication and cert generation (use "ssh-keygen -t v00 -s ca_key ..." to generate a v00 certificate) ok markus@
Diffstat (limited to 'usr.bin/ssh/ssh-rsa.c')
-rw-r--r--usr.bin/ssh/ssh-rsa.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/ssh/ssh-rsa.c b/usr.bin/ssh/ssh-rsa.c
index ce3111b9ca6..e98533cbe18 100644
--- a/usr.bin/ssh/ssh-rsa.c
+++ b/usr.bin/ssh/ssh-rsa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-rsa.c,v 1.40 2010/02/26 20:29:54 djm Exp $ */
+/* $OpenBSD: ssh-rsa.c,v 1.41 2010/04/16 01:47:26 djm Exp $ */
/*
* Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org>
*
@@ -43,9 +43,8 @@ ssh_rsa_sign(const Key *key, u_char **sigp, u_int *lenp,
int ok, nid;
Buffer b;
- if (key == NULL ||
- (key->type != KEY_RSA && key->type != KEY_RSA_CERT) ||
- key->rsa == NULL) {
+ if (key == NULL || key->rsa == NULL || (key->type != KEY_RSA &&
+ key->type != KEY_RSA_CERT && key->type != KEY_RSA_CERT_V00)) {
error("ssh_rsa_sign: no RSA key");
return -1;
}
@@ -112,9 +111,8 @@ ssh_rsa_verify(const Key *key, const u_char *signature, u_int signaturelen,
u_int len, dlen, modlen;
int rlen, ret, nid;
- if (key == NULL ||
- (key->type != KEY_RSA && key->type != KEY_RSA_CERT) ||
- key->rsa == NULL) {
+ if (key == NULL || key->rsa == NULL || (key->type != KEY_RSA &&
+ key->type != KEY_RSA_CERT && key->type != KEY_RSA_CERT_V00)) {
error("ssh_rsa_verify: no RSA key");
return -1;
}