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:
aet 2002-03-21 23:45:03 +00:00
parent 6b4a2fd599
commit 6e3a09fa7b
3 changed files with 6 additions and 8 deletions

View File

@ -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));

View File

@ -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;
@ -354,8 +353,6 @@ int p15_eid_auth(int argc, const char **argv,
EVP_PKEY_free(pubkey);
if (cert)
X509_free(cert);
if (p15cert)
sc_pkcs15_free_certificate(p15cert);
return err;
}

View File

@ -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;
}