Bugzilla – Attachment 1705 Details for
Bug 1630
ssh-keygen export of public keys (RFC4716 format) can include too-long lines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
ssh-keygen: wrap long comment lines
openbsd-ssh-keygen-wrap2.patch (text/plain), 1.60 KB, created by
Darren Tucker
on 2009-10-24 16:44:08 AEDT
(
hide
)
Description:
ssh-keygen: wrap long comment lines
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2009-10-24 16:44:08 AEDT
Size:
1.60 KB
patch
obsolete
>Index: ssh-keygen.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/ssh-keygen.c,v >retrieving revision 1.175 >diff -u -p -r1.175 ssh-keygen.c >--- ssh-keygen.c 27 Aug 2009 17:33:49 -0000 1.175 >+++ ssh-keygen.c 24 Oct 2009 05:35:14 -0000 >@@ -165,14 +165,17 @@ load_identity(char *filename) > #define SSH_COM_PUBLIC_BEGIN "---- BEGIN SSH2 PUBLIC KEY ----" > #define SSH_COM_PUBLIC_END "---- END SSH2 PUBLIC KEY ----" > #define SSH_COM_PRIVATE_BEGIN "---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ----" >-#define SSH_COM_PRIVATE_KEY_MAGIC 0x3f6ff9eb >+#define SSH_COM_PRIVATE_KEY_MAGIC 0x3f6ff9eb >+#define MAX_LINE_LEN 72 /* RFC 4716 section 3.3 */ > > static void > do_convert_to_ssh2(struct passwd *pw) > { > Key *k; >- u_int len; >+ u_int i, len; > u_char *blob; >+ char *comment; >+ size_t comment_len; > struct stat st; > > if (!have_identity) >@@ -196,10 +199,20 @@ do_convert_to_ssh2(struct passwd *pw) > exit(1); > } > fprintf(stdout, "%s\n", SSH_COM_PUBLIC_BEGIN); >- fprintf(stdout, >+ >+ /* wrap comment at MAX_LINE_LEN chars as necessary */ >+ if (xasprintf(&comment, > "Comment: \"%u-bit %s, converted from OpenSSH by %s@%s\"\n", > key_size(k), key_type(k), >- pw->pw_name, hostname); >+ pw->pw_name, hostname) == -1) >+ fatal("do_convert_to_ssh2: asprintf: %s", strerror(errno)); >+ comment_len = strlen(comment); >+ for (i = 0; i < comment_len; i++) { >+ if (i % MAX_LINE_LEN == MAX_LINE_LEN - 1 && comment[i] != '\n') >+ fprintf(stdout, "\\\n"); >+ fputc(comment[i], stdout); >+ } >+ > dump_base64(stdout, blob, len); > fprintf(stdout, "%s\n", SSH_COM_PUBLIC_END); > key_free(k);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1630
: 1705 |
1725