summaryrefslogtreecommitdiff
path: root/ssh-rsa.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-02-27 07:55:05 +1100
committerDamien Miller <djm@mindrot.org>2010-02-27 07:55:05 +1100
commit0a80ca190a39943029719facf7edb990def7ae62 (patch)
treee423e30d8412de67170b8240ba919df10ed8e391 /ssh-rsa.c
parentd27d85d5320bb946d4bb734dcf45a8d20bad6020 (diff)
- OpenBSD CVS Sync
- djm@cvs.openbsd.org 2010/02/26 20:29:54 [PROTOCOL PROTOCOL.agent PROTOCOL.certkeys addrmatch.c auth-options.c] [auth-options.h auth.h auth2-pubkey.c authfd.c dns.c dns.h hostfile.c] [hostfile.h kex.h kexdhs.c kexgexs.c key.c key.h match.h monitor.c] [myproposal.h servconf.c servconf.h ssh-add.c ssh-agent.c ssh-dss.c] [ssh-keygen.1 ssh-keygen.c ssh-rsa.c ssh.1 ssh.c ssh2.h sshconnect.c] [sshconnect2.c sshd.8 sshd.c sshd_config.5] 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 sh/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 'ssh-rsa.c')
-rw-r--r--ssh-rsa.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ssh-rsa.c b/ssh-rsa.c
index 0e16ff85f..842857fee 100644
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-rsa.c,v 1.39 2006/08/03 03:34:42 deraadt Exp $ */ 1/* $OpenBSD: ssh-rsa.c,v 1.40 2010/02/26 20:29:54 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 *
@@ -46,7 +46,9 @@ ssh_rsa_sign(const Key *key, u_char **sigp, u_int *lenp,
46 int ok, nid; 46 int ok, nid;
47 Buffer b; 47 Buffer b;
48 48
49 if (key == NULL || key->type != KEY_RSA || key->rsa == NULL) { 49 if (key == NULL ||
50 (key->type != KEY_RSA && key->type != KEY_RSA_CERT) ||
51 key->rsa == NULL) {
50 error("ssh_rsa_sign: no RSA key"); 52 error("ssh_rsa_sign: no RSA key");
51 return -1; 53 return -1;
52 } 54 }
@@ -113,7 +115,9 @@ ssh_rsa_verify(const Key *key, const u_char *signature, u_int signaturelen,
113 u_int len, dlen, modlen; 115 u_int len, dlen, modlen;
114 int rlen, ret, nid; 116 int rlen, ret, nid;
115 117
116 if (key == NULL || key->type != KEY_RSA || key->rsa == NULL) { 118 if (key == NULL ||
119 (key->type != KEY_RSA && key->type != KEY_RSA_CERT) ||
120 key->rsa == NULL) {
117 error("ssh_rsa_verify: no RSA key"); 121 error("ssh_rsa_verify: no RSA key");
118 return -1; 122 return -1;
119 } 123 }