search for: pem_read_x509

Displaying 2 results from an estimated 2 matches for "pem_read_x509".

2002 Jan 31
7
x509 for hostkeys.
...000 1.45 +++ authfile.c 31 Jan 2002 10:50:53 -0000 @@ -460,6 +460,24 @@ error("PEM_read_PrivateKey: mismatch or " "unknown EVP_PKEY save_type %d", pk->save_type); } + if (prv != NULL) { + /* try to get a certificate if we have the private key */ + prv->x509 = PEM_read_X509(fp, NULL, NULL, (char *)passphrase); + if (prv->x509 != NULL) { + debug("PEM_read_X509"); +#ifdef DEBUG_X509 + X509_print_fp(stdout, prv->x509); + { + EVP_PKEY *pkey = X509_get_pubkey(prv->x509); + if (pkey->type == EVP_PKEY_RSA) { + debug("PEM_read_X509...
2012 Sep 09
2
Patch for ssh-keygen to allow conversion of public key to openssh format
...ar **commentp) +{ + FILE *fp = NULL; + EVP_PKEY *pk = NULL; + X509 *x = NULL; + Key *pub = NULL; + char *name = "<no key>"; + + 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); +...