openpace is now a hard dependancy for pace-tool. ccid does not yet depend on pace, since the USB interface to pace is not yet defined.

git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@90 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2010-05-04 20:16:06 +00:00
parent 170ec3c703
commit 193e93ef5f
3 changed files with 18 additions and 69 deletions

View File

@@ -20,11 +20,10 @@ INSTALL_PROGRAM = $(INSTALL)
TARGETS = ccid
CCID_OBJ = ccid.o sm.o usbstring.o usb.o util.o
CCID_OBJ = ccid.o usbstring.o usb.o util.o
PTOOL_OBJ = sm.o pace-tool.o util.o pace.o pace_lib.o
ifdef PACE
CCID_OBJ += pace.o pace_lib.o
TARGETS += pace-tool
a_flags += $(OPENSSL_CFLAGS)
else

View File

@@ -20,6 +20,7 @@
#include "pace.h"
#include <stdlib.h>
#include <string.h>
#include <openssl/pace.h>
static int verbose = 0;
static int doinfo = 0;
@@ -121,23 +122,19 @@ main (int argc, char **argv)
doinfo++;
break;
case OPT_PUK:
/* PACE_PIN from openssl/pace.h */
pin_id = 4;
pin_id = PACE_PUK;
pin = optarg;
break;
case OPT_PIN:
/* PACE_PIN from openssl/pace.h */
pin_id = 3;
pin_id = PACE_PIN;
pin = optarg;
break;
case OPT_CAN:
/* PACE_PIN from openssl/pace.h */
pin_id = 2;
pin_id = PACE_CAN;
pin = optarg;
break;
case OPT_MRZ:
/* PACE_MRZ from openssl/pace.h */
pin_id = 1;
pin_id = PACE_MRZ;
pin = optarg;
break;
case OPT_CHANGE_PIN:

View File

@@ -19,12 +19,22 @@
#include "pace.h"
#include "sm.h"
#include "util.h"
#include <stdio.h>
#include <asm/byteorder.h>
#include <opensc/asn1.h>
#include <opensc/log.h>
#include <openssl/evp.h>
#include <opensc/opensc.h>
#include <opensc/ui.h>
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/buffer.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/pace.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ASN1_APP_EXP_OPT(stname, field, type, tag) ASN1_EX_TYPE(ASN1_TFLG_EXPTAG|ASN1_TFLG_APPLICATION|ASN1_TFLG_OPTIONAL, tag, stname, field, type)
@@ -139,61 +149,6 @@ ASN1_ITEM_TEMPLATE_END(PACE_GEN_AUTH_R)
IMPLEMENT_ASN1_FUNCTIONS(PACE_GEN_AUTH_R)
#ifdef NO_PACE
inline int GetReadersPACECapabilities(sc_card_t *card,
const __u8 *in, __u8 **out, size_t *outlen)
{
SC_FUNC_RETURN(card->ctx, SC_LOG_TYPE_ERROR, SC_ERROR_NOT_SUPPORTED);
}
inline int EstablishPACEChannel(sc_card_t *card, const __u8 *in,
__u8 **out, size_t *outlen, struct sm_ctx *sm_ctx)
{
SC_FUNC_RETURN(card->ctx, SC_LOG_TYPE_ERROR, SC_ERROR_NOT_SUPPORTED);
}
int pace_test(sc_card_t *card,
enum s_type pin_id, const char *pin, size_t pinlen,
enum s_type new_pin_id, const char *new_pin, size_t new_pinlen)
{
SC_FUNC_RETURN(card->ctx, SC_LOG_TYPE_ERROR, SC_ERROR_NOT_SUPPORTED);
}
int pace_sm_encrypt(sc_card_t *card, struct *sm_ctx,
const u8 *data, size_t datalen, u8 **enc)
{
SC_FUNC_RETURN(card->ctx, SC_LOG_TYPE_ERROR, SC_ERROR_NOT_SUPPORTED);
}
int pace_sm_decrypt(sc_card_t *card, struct *sm_ctx,
const u8 *enc, size_t enclen, u8 **data)
{
SC_FUNC_RETURN(card->ctx, SC_LOG_TYPE_ERROR, SC_ERROR_NOT_SUPPORTED);
}
int pace_sm_authenticate(sc_card_t *card, const struct sm_ctx *ctx,
const u8 *data, size_t datalen, u8 **macdata)
{
SC_FUNC_RETURN(card->ctx, SC_LOG_TYPE_ERROR, SC_ERROR_NOT_SUPPORTED);
}
int pace_sm_verify_authentication(sc_card_t *card, struct sm_ctx *ctx,
const u8 *mac, size_t maclen,
const u8 *macdata, size_t macdatalen)
{
SC_FUNC_RETURN(card->ctx, SC_LOG_TYPE_ERROR, SC_ERROR_NOT_SUPPORTED);
}
int pace_change_p(struct sm_ctx *ctx, sc_card_t *card, enum s_type pin_id,
const char *newp, size_t newplen)
{
SC_FUNC_RETURN(card->ctx, SC_LOG_TYPE_ERROR, SC_ERROR_NOT_SUPPORTED);
}
#else
#include <asm/byteorder.h>
#include <opensc/asn1.h>
#include <opensc/opensc.h>
#include <opensc/ui.h>
#include <openssl/err.h>
#include <openssl/objects.h>
#include <openssl/pace.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
const size_t maxresp = SC_MAX_APDU_BUFFER_SIZE - 2;
@@ -1404,5 +1359,3 @@ int pace_change_p(struct sm_ctx *ctx, sc_card_t *card, enum s_type pin_id,
SC_FUNC_RETURN(card->ctx, SC_LOG_TYPE_DEBUG, r);
}
#endif