Bugzilla – Attachment 1069 Details for
Bug 1157
ssh-keygen doesn't handle DOS line breaks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Make ssh-keygen accept CR, LF or CRLF in keys.
openssh-keygen-newline.patch (text/plain), 1022 bytes, created by
Darren Tucker
on 2006-02-15 14:38:22 AEDT
(
hide
)
Description:
Make ssh-keygen accept CR, LF or CRLF in keys.
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2006-02-15 14:38:22 AEDT
Size:
1022 bytes
patch
obsolete
>Index: ssh-keygen.c >=================================================================== >RCS file: /usr/local/src/security/openssh/cvs/openssh_cvs/ssh-keygen.c,v >retrieving revision 1.141 >diff -u -p -r1.141 ssh-keygen.c >--- ssh-keygen.c 29 Nov 2005 02:10:25 -0000 1.141 >+++ ssh-keygen.c 15 Feb 2006 03:28:18 -0000 >@@ -308,7 +308,7 @@ do_convert_from_ssh2(struct passwd *pw) > Key *k; > int blen; > u_int len; >- char line[1024], *p; >+ char line[1024], *p, *q; > u_char blob[8096]; > char encoded[8096]; > struct stat st; >@@ -328,9 +328,17 @@ do_convert_from_ssh2(struct passwd *pw) > } > encoded[0] = '\0'; > while (fgets(line, sizeof(line), fp)) { >- if (!(p = strchr(line, '\n'))) { >+ p = strchr(line, '\n'); >+ q = strchr(line, '\r'); >+ if (p == NULL && q == NULL) { > fprintf(stderr, "input line too long.\n"); > exit(1); >+ } else { >+ /* select earliest non-null line terminator */ >+ if (p == NULL) >+ p = q; >+ else if (q != NULL) >+ p = MIN(p, q); > } > if (p > line && p[-1] == '\\') > escaped++;
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 1157
:
1067
|
1068
|
1069
|
1070
|
1074
|
1078
|
1086
|
1087
|
1091