[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ssh_pki_import_pubkey_file checks for OPENSSH_HEADER_BEGIN
[Thread Prev] | [Thread Next]
- Subject: ssh_pki_import_pubkey_file checks for OPENSSH_HEADER_BEGIN
- From: g4-lisz@xxxxxxxxxxxx
- Reply-to: libssh@xxxxxxxxxx
- Date: Sun, 24 Feb 2019 18:38:07 +0100
- To: libssh@xxxxxxxxxx
... which IMHO does not make much sense: #define OPENSSH_HEADER_BEGIN "-----BEGIN OPENSSH PRIVATE KEY-----" So if we import a public key this code block will never be used: /* Test for new OpenSSH key format first */ cmp = strncmp(key_buf, OPENSSH_HEADER_BEGIN, strlen(OPENSSH_HEADER_BEGIN)); if (cmp == 0) { *pkey = ssh_pki_openssh_pubkey_import(key_buf); SAFE_FREE(key_buf); if (*pkey == NULL) { SSH_LOG(SSH_LOG_WARN, "Failed to import public key from OpenSSH" " private key file"); return SSH_ERROR; } return SSH_OK; } Or am I missing something here? Cheers, Till
Re: ssh_pki_import_pubkey_file checks for OPENSSH_HEADER_BEGIN | Jakub Jelen <jjelen@xxxxxxxxxx> |