Remove some compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1332 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
d1d502eb3a
commit
3e1dd82f4f
|
@ -569,7 +569,6 @@ static int iso7816_create_file(struct sc_card *card, struct sc_file *file)
|
|||
static int iso7816_get_response(struct sc_card *card, sc_apdu_t *orig_apdu, size_t count)
|
||||
{
|
||||
struct sc_apdu apdu;
|
||||
u8 recvbuf[SC_MAX_APDU_BUFFER_SIZE];
|
||||
int r;
|
||||
|
||||
sc_format_apdu(card, &apdu, SC_APDU_CASE_2_SHORT, 0xC0, 0x00, 0x00);
|
||||
|
|
|
@ -1188,7 +1188,7 @@ CK_RV pkcs15_gen_keypair(struct sc_pkcs11_card *p11card, struct sc_pkcs11_slot *
|
|||
CK_ULONG keybits;
|
||||
char pub_label[SC_PKCS15_MAX_LABEL_SIZE];
|
||||
char priv_label[SC_PKCS15_MAX_LABEL_SIZE];
|
||||
int j, rc, rv = CKR_OK;
|
||||
int rc, rv = CKR_OK;
|
||||
|
||||
debug(context, "Keypair generation, mech = 0x%0x\n", pMechanism->mechanism);
|
||||
|
||||
|
|
|
@ -917,9 +917,11 @@ CK_RV C_VerifyInit(CK_SESSION_HANDLE hSession, /* the session's handle */
|
|||
#ifndef HAVE_OPENSSL
|
||||
return CKR_FUNCTION_NOT_SUPPORTED;
|
||||
#else
|
||||
#if 0
|
||||
CK_BBOOL can_verify;
|
||||
CK_KEY_TYPE key_type;
|
||||
CK_ATTRIBUTE verify_attribute = { CKA_VERIFY, &can_verify, sizeof(can_verify) };
|
||||
#endif
|
||||
CK_KEY_TYPE key_type;
|
||||
CK_ATTRIBUTE key_type_attr = { CKA_KEY_TYPE, &key_type, sizeof(key_type) };
|
||||
struct sc_pkcs11_session *session;
|
||||
struct sc_pkcs11_object *object;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <opensc/opensc.h>
|
||||
|
|
|
@ -934,10 +934,7 @@ void
|
|||
set_id_attr(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
|
||||
{
|
||||
CK_OBJECT_HANDLE obj;
|
||||
CK_ATTRIBUTE templ[] = {CKA_ID, new_object_id, new_object_id_len};
|
||||
#if 0
|
||||
CK_ATTRIBUTE templ2[] = {CKA_LABEL, "new_label", 9};
|
||||
#endif
|
||||
CK_ATTRIBUTE templ[] = {{CKA_ID, new_object_id, new_object_id_len}};
|
||||
CK_RV rv;
|
||||
|
||||
if (!find_object(session, opt_object_class, &obj, opt_object_id, opt_object_id_len, 0)) {
|
||||
|
@ -1783,7 +1780,6 @@ sign_verify(CK_SLOT_ID slot, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE priv_ke
|
|||
CK_OBJECT_HANDLE pub_key, int one_test)
|
||||
{
|
||||
CK_RV rv;
|
||||
int count;
|
||||
CK_MECHANISM_TYPE mech_types[] = {
|
||||
CKM_RSA_X_509,
|
||||
CKM_RSA_PKCS,
|
||||
|
@ -1809,7 +1805,8 @@ sign_verify(CK_SLOT_ID slot, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE priv_ke
|
|||
456
|
||||
};
|
||||
unsigned char signat[512];
|
||||
int j, signat_len, errors = 0;
|
||||
CK_ULONG signat_len;
|
||||
int j, errors = 0;
|
||||
|
||||
for (j = 0, mech_type = mech_types; *mech_type != 0xffffff; mech_type++, j++) {
|
||||
CK_MECHANISM mech = {*mech_type, NULL, 0};
|
||||
|
@ -1886,9 +1883,9 @@ test_verify(CK_SLOT_ID slot, CK_SESSION_HANDLE sess)
|
|||
|
||||
for (i = 0; find_object(sess, CKO_PRIVATE_KEY, &priv_key, NULL, 0, i); i++) {
|
||||
char *label, *id;
|
||||
int id_len, err;
|
||||
CK_ULONG id_len;
|
||||
|
||||
printf(" testing key %ld", i);
|
||||
printf(" testing key %d", i);
|
||||
if ((label = getLABEL(sess, priv_key, NULL)) != NULL) {
|
||||
printf(" (%s)", label);
|
||||
free(label);
|
||||
|
@ -2219,8 +2216,6 @@ test_kpgen_certwrite(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
|
|||
{CKA_LABEL, label, label_len},
|
||||
{CKA_SUBJECT, "This won't be used in our lib", 29}
|
||||
};
|
||||
unsigned char cert[5000];
|
||||
int cert_len;
|
||||
FILE *f;
|
||||
|
||||
get_mechanisms(slot, &mech_type, &num_mechs);
|
||||
|
@ -2275,7 +2270,7 @@ test_kpgen_certwrite(CK_SLOT_ID slot, CK_SESSION_HANDLE session)
|
|||
rv = p11->C_Sign(session, data, data_len, NULL, &sig_len);
|
||||
if (rv != CKR_OK)
|
||||
p11_fatal("C_Sign", rv);
|
||||
printf("sig_len = %d\n", sig_len);
|
||||
printf("sig_len = %ld\n", sig_len);
|
||||
sig_len = 20;
|
||||
rv = p11->C_Sign(session, data, data_len, sig, &sig_len);
|
||||
if (rv != CKR_BUFFER_TOO_SMALL) {
|
||||
|
|
Loading…
Reference in New Issue