Bugzilla – Attachment 2940 Details for
Bug 2520
ssh-keygen: sanitize ANSI escape sequences in key comment
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
sanitise escape sequences but not valid UTF-8 when the locale supports it
bz2520.diff (text/plain), 1.89 KB, created by
Damien Miller
on 2017-02-10 14:00:24 AEDT
(
hide
)
Description:
sanitise escape sequences but not valid UTF-8 when the locale supports it
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2017-02-10 14:00:24 AEDT
Size:
1.89 KB
patch
obsolete
>Index: ssh-keygen.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/ssh-keygen.c,v >retrieving revision 1.293 >diff -u -p -r1.293 ssh-keygen.c >--- ssh-keygen.c 8 Feb 2017 20:32:43 -0000 1.293 >+++ ssh-keygen.c 10 Feb 2017 02:58:44 -0000 >@@ -28,6 +28,7 @@ > #include <string.h> > #include <unistd.h> > #include <limits.h> >+#include <locale.h> > > #include "xmalloc.h" > #include "sshkey.h" >@@ -47,6 +48,7 @@ > #include "atomicio.h" > #include "krl.h" > #include "digest.h" >+#include "utf8.h" > > #ifdef ENABLE_PKCS11 > #include "ssh-pkcs11.h" >@@ -829,7 +831,7 @@ fingerprint_one_key(const struct sshkey > ra = sshkey_fingerprint(public, fingerprint_hash, SSH_FP_RANDOMART); > if (fp == NULL || ra == NULL) > fatal("%s: sshkey_fingerprint failed", __func__); >- printf("%u %s %s (%s)\n", sshkey_size(public), fp, >+ mprintf("%u %s %s (%s)\n", sshkey_size(public), fp, > comment ? comment : "no comment", sshkey_type(public)); > if (log_level >= SYSLOG_LEVEL_VERBOSE) > printf("%s\n", ra); >@@ -1150,7 +1152,7 @@ known_hosts_find_delete(struct hostkey_f > known_hosts_hash(l, ctx); > else if (print_fingerprint) { > fp = sshkey_fingerprint(l->key, fptype, rep); >- printf("%s %s %s %s\n", ctx->host, >+ mprintf("%s %s %s %s\n", ctx->host, > sshkey_type(l->key), fp, l->comment); > free(fp); > } else >@@ -1301,7 +1303,7 @@ do_change_passphrase(struct passwd *pw) > fatal("Failed to load key %s: %s", identity_file, ssh_err(r)); > } > if (comment) >- printf("Key has comment '%s'\n", comment); >+ mprintf("Key has comment '%s'\n", comment); > > /* Ask the new passphrase (twice). */ > if (identity_new_passphrase) { >@@ -2262,6 +2264,8 @@ main(int argc, char **argv) > > OpenSSL_add_all_algorithms(); > log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1); >+ >+ setlocale(LC_CTYPE, ""); > > /* we need this for the home * directory. */ > pw = getpwuid(getuid());
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
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2520
:
2775
|
2776
|
2777
| 2940