diff options
author | Axel Eppe <aeppe@google.com> | 2016-03-01 00:39:51 +0000 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2016-03-15 08:36:09 +0100 |
commit | 6cbab4936d419f980fdb55a79f5f23ed51043c7e (patch) | |
tree | 0497f276d624e28faf1b4f2b6583537a31ff2675 /src/pki_gcrypt.c | |
parent | 0310cba2b6611ac60c2118fe830bd478d7da6bf8 (diff) | |
download | libssh-6cbab4936d419f980fdb55a79f5f23ed51043c7e.tar.gz libssh-6cbab4936d419f980fdb55a79f5f23ed51043c7e.tar.xz libssh-6cbab4936d419f980fdb55a79f5f23ed51043c7e.zip |
pki_gcrypt: Add cert auth support to pki_publickey_to_blob()
Signed-off-by: Axel Eppe <aeppe@google.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/pki_gcrypt.c')
-rw-r--r-- | src/pki_gcrypt.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pki_gcrypt.c b/src/pki_gcrypt.c index 16e4833e..f7f9e355 100644 --- a/src/pki_gcrypt.c +++ b/src/pki_gcrypt.c @@ -1164,6 +1164,15 @@ ssh_string pki_publickey_to_blob(const ssh_key key) return NULL; } + if (key->cert != NULL) { + rc = ssh_buffer_add_buffer(buffer, key->cert); + if (rc < 0) { + ssh_buffer_free(buffer); + return NULL; + } + goto makestring; + } + type_s = ssh_string_from_char(key->type_c); if (type_s == NULL) { ssh_buffer_free(buffer); @@ -1300,6 +1309,7 @@ ssh_string pki_publickey_to_blob(const ssh_key key) goto fail; } +makestring: str = ssh_string_new(ssh_buffer_get_len(buffer)); if (str == NULL) { goto fail; |