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 * static RSA *
read_key(ENGINE *engine, const char *rsa_key) read_key(ENGINE *engine, const char *keyfile)
{ {
unsigned char buf[1024 * 4]; unsigned char buf[1024 * 4];
const unsigned char *p; const unsigned char *p;
@@ -157,22 +157,22 @@ read_key(ENGINE *engine, const char *rsa_key)
RSA *rsa; RSA *rsa;
FILE *f; FILE *f;
f = fopen(rsa_key, "rb"); f = fopen(keyfile, "rb");
if (f == NULL) if (f == NULL)
err(1, "could not open file %s", rsa_key); err(1, "could not open file %s", keyfile);
rk_cloexec_file(f); rk_cloexec_file(f);
size = fread(buf, 1, sizeof(buf), f); size = fread(buf, 1, sizeof(buf), f);
fclose(f); fclose(f);
if (size == 0) if (size == 0)
err(1, "failed to read file %s", rsa_key); err(1, "failed to read file %s", keyfile);
if (size == sizeof(buf)) 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; p = buf;
rsa = d2i_RSAPrivateKey(NULL, &p, size); rsa = d2i_RSAPrivateKey(NULL, &p, size);
if (rsa == NULL) 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)); RSA_set_method(rsa, ENGINE_get_RSA(engine));