X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fopenssl%2Frsa.c;h=9c1f4984ba1f4fbbddf0715643ea37a4a10fa7f4;hp=20bfb65a072b2926e26a1e21191c32dcd3c0aa2b;hb=09e000ba54fd4a4ffe3e5c15ee7aeadac35d6996;hpb=44c7f554c7a6eb411428cfd30ca2cb21a613830e diff --git a/src/openssl/rsa.c b/src/openssl/rsa.c index 20bfb65a..9c1f4984 100644 --- a/src/openssl/rsa.c +++ b/src/openssl/rsa.c @@ -61,8 +61,10 @@ rsa_t *rsa_set_hex_private_key(char *n, char *e, char *d) { rsa_t *rsa_read_pem_public_key(FILE *fp) { rsa_t *rsa = PEM_read_RSAPublicKey(fp, NULL, NULL, NULL); - if(!rsa) + if(!rsa) { + rewind(fp); rsa = PEM_read_RSA_PUBKEY(fp, NULL, NULL, NULL); + } if(!rsa) logger(DEBUG_ALWAYS, LOG_ERR, "Unable to read RSA public key: %s", ERR_error_string(ERR_get_error(), NULL));