fix -Wshadow

This commit is contained in:
Love Hörnquist Åstrand
2012-11-17 14:14:52 -08:00
parent 6d783560e4
commit 9ad763288d

View File

@@ -149,7 +149,7 @@ cb_func(int a, int b, BN_GENCB *c)
}
static RSA *
read_key(ENGINE *engine, const char *rsa_key)
read_key(ENGINE *engine, const char *keyfile)
{
unsigned char buf[1024 * 4];
const unsigned char *p;
@@ -157,22 +157,22 @@ read_key(ENGINE *engine, const char *rsa_key)
RSA *rsa;
FILE *f;
f = fopen(rsa_key, "rb");
f = fopen(keyfile, "rb");
if (f == NULL)
err(1, "could not open file %s", rsa_key);
err(1, "could not open file %s", keyfile);
rk_cloexec_file(f);
size = fread(buf, 1, sizeof(buf), f);
fclose(f);
if (size == 0)
err(1, "failed to read file %s", rsa_key);
err(1, "failed to read file %s", keyfile);
if (size == sizeof(buf))
err(1, "key too long in file %s!", rsa_key);
err(1, "key too long in file %s!", keyfile);
p = buf;
rsa = d2i_RSAPrivateKey(NULL, &p, size);
if (rsa == NULL)
err(1, "failed to parse key in file %s", rsa_key);
err(1, "failed to parse key in file %s", keyfile);
RSA_set_method(rsa, ENGINE_get_RSA(engine));