let OpenSC compile without OpenSSL and without SM

This commit is contained in:
Frank Morgner 2013-07-10 16:22:33 +02:00
parent 962cba98db
commit 9a05414f9a
5 changed files with 15 additions and 11 deletions

View File

@ -2,10 +2,10 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
EXTRA_DIST = Makefile.mak
# Order IS important
SUBDIRS = common scconf libsm pkcs15init libopensc pkcs11 \
SUBDIRS = common scconf pkcs15init libopensc pkcs11 \
tools tests minidriver
if ENABLE_SM
SUBDIRS += smm
SUBDIRS += smm libsm
endif

View File

@ -26,16 +26,13 @@
#include "asn1.h"
#include "cardctl.h"
#ifndef ENABLE_OPENSSL
#error "Need OpenSSL"
#endif
#include "sm.h"
#include "iasecc.h"
#include "authentic.h"
#ifdef ENABLE_SM
static int
sm_save_sc_context (struct sc_card *card, struct sm_info *sm_info)
{

View File

@ -312,7 +312,6 @@ sc_pkcs15_convert_pubkey
sc_sm_parse_answer
sc_sm_update_apdu_response
sc_sm_single_transmit
iasecc_sdo_encode_update_field
iasecc_sm_create_file
iasecc_sm_delete_file
iasecc_sm_external_authentication

View File

@ -27,6 +27,7 @@
#include "internal.h"
#include "asn1.h"
#include "sm.h"
static const struct sc_asn1_entry c_asn1_sm_response[4] = {
{ "encryptedData", SC_ASN1_OCTET_STRING, SC_ASN1_CTX | 7, SC_ASN1_OPTIONAL, NULL, NULL },
@ -160,14 +161,14 @@ sc_sm_single_transmit(struct sc_card *card, struct sc_apdu *apdu)
}
#else
int
sc_sm_parse_answer(struct sc_context *ctx, unsigned char *resp_data, size_t resp_len,
sc_sm_parse_answer(struct sc_card *card, unsigned char *resp_data, size_t resp_len,
struct sm_card_response *out)
{
return SC_ERROR_NOT_SUPPORTED;
}
int
sc_sm_update_apdu_response(struct sc_card *card, unsigned char *resp_data, size_t resp_len, int ref_rv,
struct sc_apdu *apdu)
sc_sm_update_apdu_response(struct sc_card *card, unsigned char *resp_data, size_t resp_len,
int ref_rv, struct sc_apdu *apdu)
{
return SC_ERROR_NOT_SUPPORTED;
}

View File

@ -164,12 +164,14 @@ static int lock_card(struct pkcs15_fw_data *);
static int unlock_card(struct pkcs15_fw_data *);
static int reselect_app_df(sc_pkcs15_card_t *p15card);
#ifdef USE_PKCS15_INIT
static CK_RV set_gost_params(struct sc_pkcs15init_keyarg_gost_params *,
struct sc_pkcs15init_keyarg_gost_params *,
CK_ATTRIBUTE_PTR, CK_ULONG, CK_ATTRIBUTE_PTR, CK_ULONG);
static CK_RV pkcs15_create_slot(struct sc_pkcs11_card *p11card, struct pkcs15_fw_data *fw_data,
struct sc_pkcs15_object *auth, struct sc_app_info *app,
struct sc_pkcs11_slot **out);
#endif
/* Returns WF data corresponding to the given application or,
* if application info is not supplied, returns first available WF data. */
@ -2721,6 +2723,9 @@ kpgen_done:
static CK_RV
pkcs15_skey_destroy(struct sc_pkcs11_session *session, void *object)
{
#ifndef USE_PKCS15_INIT
return CKR_FUNCTION_NOT_SUPPORTED;
#else
struct pkcs15_any_object *any_obj = (struct pkcs15_any_object*) object;
struct sc_pkcs11_card *p11card = session->slot->card;
struct pkcs15_fw_data *fw_data = NULL;
@ -2746,6 +2751,7 @@ pkcs15_skey_destroy(struct sc_pkcs11_session *session, void *object)
return sc_to_cryptoki_error(rv, "C_DestroyObject");
return CKR_OK;
#endif
}
static CK_RV
@ -2852,8 +2858,8 @@ struct sc_pkcs11_framework_ops framework_pkcs15 = {
pkcs15_login,
pkcs15_logout,
pkcs15_change_pin,
pkcs15_initialize,
#ifdef USE_PKCS15_INIT
pkcs15_initialize,
pkcs15_init_pin,
pkcs15_create_object,
pkcs15_gen_keypair,
@ -2861,6 +2867,7 @@ struct sc_pkcs11_framework_ops framework_pkcs15 = {
NULL,
NULL,
NULL,
NULL,
#endif
pkcs15_get_random
};