diff options
author | Colin Watson <cjwatson@ubuntu.com> | 2014-02-09 16:09:50 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2014-02-09 16:17:31 +0000 |
commit | 8909ff0e3cd07d1b042d1be1c8b8828dbf6c9a83 (patch) | |
tree | ebee4092f1411059e34da6f66b4ebd64f4411020 /ssh-add.c | |
parent | 07f2a771c490bd68cd5c5ea9c535705e93bd94f3 (diff) |
Reject vulnerable keys to mitigate Debian OpenSSL flaw
In 2008, Debian (and derived distributions such as Ubuntu) shipped an
OpenSSL package with a flawed random number generator, causing OpenSSH to
generate only a very limited set of keys which were subject to private half
precomputation. To mitigate this, this patch checks key authentications
against a blacklist of known-vulnerable keys, and adds a new ssh-vulnkey
program which can be used to explicitly check keys against that blacklist.
See CVE-2008-0166.
Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=1469
Last-Update: 2013-09-14
Patch-Name: ssh-vulnkey.patch
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -167,7 +167,7 @@ static int | |||
167 | add_file(AuthenticationConnection *ac, const char *filename, int key_only) | 167 | add_file(AuthenticationConnection *ac, const char *filename, int key_only) |
168 | { | 168 | { |
169 | Key *private, *cert; | 169 | Key *private, *cert; |
170 | char *comment = NULL; | 170 | char *comment = NULL, *fp; |
171 | char msg[1024], *certpath = NULL; | 171 | char msg[1024], *certpath = NULL; |
172 | int fd, perms_ok, ret = -1; | 172 | int fd, perms_ok, ret = -1; |
173 | Buffer keyblob; | 173 | Buffer keyblob; |
@@ -243,6 +243,14 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only) | |||
243 | } else { | 243 | } else { |
244 | fprintf(stderr, "Could not add identity: %s\n", filename); | 244 | fprintf(stderr, "Could not add identity: %s\n", filename); |
245 | } | 245 | } |
246 | if (blacklisted_key(private, &fp) == 1) { | ||
247 | fprintf(stderr, "Public key %s blacklisted (see " | ||
248 | "ssh-vulnkey(1)); refusing to add it\n", fp); | ||
249 | free(fp); | ||
250 | key_free(private); | ||
251 | free(comment); | ||
252 | return -1; | ||
253 | } | ||
246 | 254 | ||
247 | /* Skip trying to load the cert if requested */ | 255 | /* Skip trying to load the cert if requested */ |
248 | if (key_only) | 256 | if (key_only) |