[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ssh_pki_import_pubkey_file checks for OPENSSH_HEADER_BEGIN


... 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


Follow-Ups:
Re: ssh_pki_import_pubkey_file checks for OPENSSH_HEADER_BEGINJakub Jelen <jjelen@xxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org