pki: Fix ssh_pki_import_pubkey_base64().
Этот коммит содержится в:
родитель
96e338ba56
Коммит
54a2b8a303
11
src/pki.c
11
src/pki.c
@ -510,6 +510,7 @@ int ssh_pki_import_pubkey_base64(ssh_session session,
|
|||||||
enum ssh_keytypes_e type,
|
enum ssh_keytypes_e type,
|
||||||
ssh_key *pkey) {
|
ssh_key *pkey) {
|
||||||
ssh_buffer buffer;
|
ssh_buffer buffer;
|
||||||
|
ssh_string type_s;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (session == NULL || b64_key == NULL || pkey == NULL) {
|
if (session == NULL || b64_key == NULL || pkey == NULL) {
|
||||||
@ -517,6 +518,16 @@ int ssh_pki_import_pubkey_base64(ssh_session session,
|
|||||||
}
|
}
|
||||||
|
|
||||||
buffer = base64_to_bin(b64_key);
|
buffer = base64_to_bin(b64_key);
|
||||||
|
if (buffer == NULL) {
|
||||||
|
return SSH_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
type_s = buffer_get_ssh_string(buffer);
|
||||||
|
if (type_s == NULL) {
|
||||||
|
ssh_buffer_free(buffer);
|
||||||
|
return SSH_ERROR;
|
||||||
|
}
|
||||||
|
ssh_string_free(type_s);
|
||||||
|
|
||||||
rc = pki_import_pubkey_buffer(session, buffer, type, pkey);
|
rc = pki_import_pubkey_buffer(session, buffer, type, pkey);
|
||||||
ssh_buffer_free(buffer);
|
ssh_buffer_free(buffer);
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user