Remove bogus "len = len;" statement from pkcs15-cert
Other minor cleanups git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@368 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
6b4a2fd599
commit
6e3a09fa7b
|
@ -143,7 +143,6 @@ int sc_pkcs15_read_certificate(struct sc_pkcs15_card *p15card,
|
|||
free(data);
|
||||
return r;
|
||||
}
|
||||
len = len;
|
||||
sc_unlock(p15card->card);
|
||||
}
|
||||
cert = malloc(sizeof(struct sc_pkcs15_cert));
|
||||
|
|
|
@ -284,7 +284,7 @@ static int get_certificate(const char *user, X509 ** cert_out)
|
|||
goto end;
|
||||
*cert_out = cert;
|
||||
err = SCAM_SUCCESS;
|
||||
end:
|
||||
end:
|
||||
if (in)
|
||||
BIO_free(in);
|
||||
if (dir)
|
||||
|
@ -297,7 +297,6 @@ static int get_certificate(const char *user, X509 ** cert_out)
|
|||
int p15_eid_auth(int argc, const char **argv,
|
||||
const char *user, const char *password)
|
||||
{
|
||||
struct sc_pkcs15_cert *p15cert = NULL;
|
||||
u8 random_data[20], chg[256], txt[256];
|
||||
int r, err = SCAM_FAILED, chglen;
|
||||
EVP_PKEY *pubkey = NULL;
|
||||
|
@ -349,13 +348,11 @@ int p15_eid_auth(int argc, const char **argv,
|
|||
if (r == sizeof(random_data) && !memcmp(txt, random_data, r)) {
|
||||
err = SCAM_SUCCESS;
|
||||
}
|
||||
end:
|
||||
end:
|
||||
if (pubkey)
|
||||
EVP_PKEY_free(pubkey);
|
||||
if (cert)
|
||||
X509_free(cert);
|
||||
if (p15cert)
|
||||
sc_pkcs15_free_certificate(p15cert);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
@ -234,6 +234,7 @@ int p15_ldap_auth(int argc, const char **argv,
|
|||
int r, err = SCAM_FAILED, chglen;
|
||||
EVP_PKEY *pubkey = NULL;
|
||||
X509 *cert = NULL;
|
||||
unsigned char *ptr = NULL;
|
||||
|
||||
if (!lctx || !ctx)
|
||||
return SCAM_FAILED;
|
||||
|
@ -243,7 +244,8 @@ int p15_ldap_auth(int argc, const char **argv,
|
|||
goto end;
|
||||
}
|
||||
cert = X509_new();
|
||||
if (!d2i_X509(&cert, &p15cert->data, p15cert->data_len)) {
|
||||
ptr = p15cert->data;
|
||||
if (!d2i_X509(&cert, &ptr, p15cert->data_len)) {
|
||||
scam_fw_p15_ldap.logmsg("Invalid certificate. (user %s)\n", user);
|
||||
goto end;
|
||||
}
|
||||
|
@ -281,7 +283,7 @@ int p15_ldap_auth(int argc, const char **argv,
|
|||
if (r == sizeof(random_data) && !memcmp(txt, random_data, r)) {
|
||||
err = SCAM_SUCCESS;
|
||||
}
|
||||
end:
|
||||
end:
|
||||
if (pubkey)
|
||||
EVP_PKEY_free(pubkey);
|
||||
if (cert)
|
||||
|
|
Loading…
Reference in New Issue