summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-dss.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2010-02-26 20:29:54 +0000
committerdjm <djm@openbsd.org>2010-02-26 20:29:54 +0000
commitb94e498ee01728630740033222d91168419128b4 (patch)
tree00cafcbcc946aee33ddeab7d750bbadcb35ff01d /usr.bin/ssh/ssh-dss.c
parentBack out the last commit. Bizzarely, that extra l@ makes boong from CD fail! (diff)
downloadwireguard-openbsd-b94e498ee01728630740033222d91168419128b4.tar.xz
wireguard-openbsd-b94e498ee01728630740033222d91168419128b4.zip
Add support for certificate key types for users and hosts.
OpenSSH certificate key types are not X.509 certificates, but a much simpler format that encodes a public key, identity information and some validity constraints and signs it with a CA key. CA keys are regular SSH keys. This certificate style avoids the attack surface of X.509 certificates and is very easy to deploy. Certified host keys allow automatic acceptance of new host keys when a CA certificate is marked as trusted in ~/.ssh/known_hosts. see VERIFYING HOST KEYS in ssh(1) for details. Certified user keys allow authentication of users when the signing CA key is marked as trusted in authorized_keys. See "AUTHORIZED_KEYS FILE FORMAT" in sshd(8) for details. Certificates are minted using ssh-keygen(1), documentation is in the "CERTIFICATES" section of that manpage. Documentation on the format of certificates is in the file PROTOCOL.certkeys feedback and ok markus@
Diffstat (limited to 'usr.bin/ssh/ssh-dss.c')
-rw-r--r--usr.bin/ssh/ssh-dss.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh-dss.c b/usr.bin/ssh/ssh-dss.c
index 49cc6164435..a35130d7862 100644
--- a/usr.bin/ssh/ssh-dss.c
+++ b/usr.bin/ssh/ssh-dss.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-dss.c,v 1.24 2006/11/06 21:25:28 markus Exp $ */
+/* $OpenBSD: ssh-dss.c,v 1.25 2010/02/26 20:29:54 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
*
@@ -50,7 +50,9 @@ ssh_dss_sign(const Key *key, u_char **sigp, u_int *lenp,
u_int rlen, slen, len, dlen;
Buffer b;
- if (key == NULL || key->type != KEY_DSA || key->dsa == NULL) {
+ if (key == NULL ||
+ (key->type != KEY_DSA && key->type != KEY_DSA_CERT) ||
+ key->dsa == NULL) {
error("ssh_dss_sign: no DSA key");
return -1;
}
@@ -113,7 +115,9 @@ ssh_dss_verify(const Key *key, const u_char *signature, u_int signaturelen,
int rlen, ret;
Buffer b;
- if (key == NULL || key->type != KEY_DSA || key->dsa == NULL) {
+ if (key == NULL ||
+ (key->type != KEY_DSA && key->type != KEY_DSA_CERT) ||
+ key->dsa == NULL) {
error("ssh_dss_verify: no DSA key");
return -1;
}