diff options
author | Jan Cholasta <jcholast@redhat.com> | 2012-04-18 07:05:29 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-04-24 09:50:56 -0400 |
commit | 4fa3ef8d8a8a3cddf8025d306c3b90b37dd431bc (patch) | |
tree | 34d80280cfa9ae80139808f6af0df6f668f8ed4e /src/util | |
parent | b35f20cd8ecdc8308a3201e55752fb0443ec6ae4 (diff) | |
download | sssd-4fa3ef8d8a8a3cddf8025d306c3b90b37dd431bc.tar.gz sssd-4fa3ef8d8a8a3cddf8025d306c3b90b37dd431bc.tar.bz2 sssd-4fa3ef8d8a8a3cddf8025d306c3b90b37dd431bc.zip |
SSH: Add support for hashed known_hosts
https://fedorahosted.org/sssd/ticket/1203
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/sss_ssh.c | 9 | ||||
-rw-r--r-- | src/util/sss_ssh.h | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/util/sss_ssh.c b/src/util/sss_ssh.c index 0163c1d8..60ed5878 100644 --- a/src/util/sss_ssh.c +++ b/src/util/sss_ssh.c @@ -136,13 +136,18 @@ char * sss_ssh_format_pubkey(TALLOC_CTX *mem_ctx, struct sss_ssh_ent *ent, struct sss_ssh_pubkey *pubkey, - enum sss_ssh_pubkey_format format) + enum sss_ssh_pubkey_format format, + const char *comment) { TALLOC_CTX *tmp_ctx; char *blob; char *algo; char *result = NULL; + if (!comment) { + comment = ent->name; + } + tmp_ctx = talloc_new(NULL); if (!tmp_ctx) { return NULL; @@ -166,7 +171,7 @@ sss_ssh_format_pubkey(TALLOC_CTX *mem_ctx, goto done; } - result = talloc_asprintf(mem_ctx, "%s %s %s", algo, blob, ent->name); + result = talloc_asprintf(mem_ctx, "%s %s %s", algo, blob, comment); break; } diff --git a/src/util/sss_ssh.h b/src/util/sss_ssh.h index a4ac7391..29743a08 100644 --- a/src/util/sss_ssh.h +++ b/src/util/sss_ssh.h @@ -54,6 +54,7 @@ char * sss_ssh_format_pubkey(TALLOC_CTX *mem_ctx, struct sss_ssh_ent *ent, struct sss_ssh_pubkey *pubkey, - enum sss_ssh_pubkey_format format); + enum sss_ssh_pubkey_format format, + const char *comment); #endif /* _SSS_SSH_H_ */ |