search for: pem_read_pubkey

Displaying 1 result from an estimated 1 matches for "pem_read_pubkey".

2012 Sep 09
2
Patch for ssh-keygen to allow conversion of public key to openssh format
...+ fp = fopen(filename, "r"); + if (fp == NULL) { + error("fopen of %s failed: %s", filename, strerror(errno)); + return NULL; + } + x = PEM_read_X509(fp, NULL, NULL, NULL); + if (x == NULL) { + debug3("Not X509 format, try public key format"); + rewind(fp); + pk = PEM_read_PUBKEY(fp, NULL, NULL, NULL); + } else { + pk = X509_get_pubkey(x); + } + if (pk == NULL) { + debug("PEM_read_PUBKEY() file %s failed", filename); + debug3("%s", ERR_error_string(ERR_get_error(), NULL)); + if (x != NULL) + X509_free(x); + return NULL; + } else { + pub = key_new...