1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

pki_crypto: Add cert auth support to pki_publickey_to_blob()

Signed-off-by: Axel Eppe <aeppe@google.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Axel Eppe
2016-03-01 00:35:48 +00:00
committed by Andreas Schneider
parent 0b9804a95b
commit 0310cba2b6

View File

@@ -882,6 +882,15 @@ ssh_string pki_publickey_to_blob(const ssh_key key)
return NULL; 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); type_s = ssh_string_from_char(key->type_c);
if (type_s == NULL) { if (type_s == NULL) {
ssh_buffer_free(buffer); ssh_buffer_free(buffer);
@@ -1034,6 +1043,7 @@ ssh_string pki_publickey_to_blob(const ssh_key key)
goto fail; goto fail;
} }
makestring:
str = ssh_string_new(ssh_buffer_get_len(buffer)); str = ssh_string_new(ssh_buffer_get_len(buffer));
if (str == NULL) { if (str == NULL) {
goto fail; goto fail;