diff options
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r-- | ssh-keygen.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c index 5fcd3a159..c5130c86e 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-keygen.c,v 1.212 2011/10/16 15:02:41 jmc Exp $ */ | 1 | /* $OpenBSD: ssh-keygen.c,v 1.213 2012/02/29 11:21:26 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -265,6 +265,10 @@ do_convert_to_ssh2(struct passwd *pw, Key *k) | |||
265 | u_char *blob; | 265 | u_char *blob; |
266 | char comment[61]; | 266 | char comment[61]; |
267 | 267 | ||
268 | if (k->type == KEY_RSA1) { | ||
269 | fprintf(stderr, "version 1 keys are not supported\n"); | ||
270 | exit(1); | ||
271 | } | ||
268 | if (key_to_blob(k, &blob, &len) <= 0) { | 272 | if (key_to_blob(k, &blob, &len) <= 0) { |
269 | fprintf(stderr, "key_to_blob failed\n"); | 273 | fprintf(stderr, "key_to_blob failed\n"); |
270 | exit(1); | 274 | exit(1); |
@@ -288,6 +292,7 @@ static void | |||
288 | do_convert_to_pkcs8(Key *k) | 292 | do_convert_to_pkcs8(Key *k) |
289 | { | 293 | { |
290 | switch (key_type_plain(k->type)) { | 294 | switch (key_type_plain(k->type)) { |
295 | case KEY_RSA1: | ||
291 | case KEY_RSA: | 296 | case KEY_RSA: |
292 | if (!PEM_write_RSA_PUBKEY(stdout, k->rsa)) | 297 | if (!PEM_write_RSA_PUBKEY(stdout, k->rsa)) |
293 | fatal("PEM_write_RSA_PUBKEY failed"); | 298 | fatal("PEM_write_RSA_PUBKEY failed"); |
@@ -312,6 +317,7 @@ static void | |||
312 | do_convert_to_pem(Key *k) | 317 | do_convert_to_pem(Key *k) |
313 | { | 318 | { |
314 | switch (key_type_plain(k->type)) { | 319 | switch (key_type_plain(k->type)) { |
320 | case KEY_RSA1: | ||
315 | case KEY_RSA: | 321 | case KEY_RSA: |
316 | if (!PEM_write_RSAPublicKey(stdout, k->rsa)) | 322 | if (!PEM_write_RSAPublicKey(stdout, k->rsa)) |
317 | fatal("PEM_write_RSAPublicKey failed"); | 323 | fatal("PEM_write_RSAPublicKey failed"); |
@@ -345,10 +351,6 @@ do_convert_to(struct passwd *pw) | |||
345 | exit(1); | 351 | exit(1); |
346 | } | 352 | } |
347 | } | 353 | } |
348 | if (k->type == KEY_RSA1) { | ||
349 | fprintf(stderr, "version 1 keys are not supported\n"); | ||
350 | exit(1); | ||
351 | } | ||
352 | 354 | ||
353 | switch (convert_format) { | 355 | switch (convert_format) { |
354 | case FMT_RFC4716: | 356 | case FMT_RFC4716: |