Check-in [6723914ef9]
Overview
Comment:Removed incomplete and never-used SPM implementation
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6723914ef908adb365b0baaf9bd599a2c7d44052
User & Date: rkeene on 2011-08-24 03:44:12
Other Links: manifest | tags
Context
2011-08-25
04:00
Fixed bug in UUID of package

Added PKCS11.tokend package to CACKey on Mac OS X

Removed legacy (pre-Mac OS X 10.5) build support check-in: 059330a9a5 user: rkeene tags: trunk

2011-08-24
03:44
Removed incomplete and never-used SPM implementation check-in: 6723914ef9 user: rkeene tags: trunk
03:36
Corrected typo check-in: 8cb81a67c7 user: rkeene tags: trunk
Changes

Deleted cackey_spm.c version [2a7170f089].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
 * GSC-IS (v2.1) Service Call Level Service Provider Module for PC/SC Lite and
 * DoD CAC/CACv2/PIV/PIVv2 Cards
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "cackey_spm.h"

#ifdef HAVE_STDIO_H
#  include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#  include <stdlib.h>
#endif

unsigned long gscBsiUtilAcquireContext(unsigned long hCard, unsigned char *AID, struct BSIAuthenticator strctAuthenticator[], unsigned long authNb) {
}

unsigned long gscBsiUtilConnect(unsigned char *readerName, unsigned long *hCard) {
}

unsigned long gscBsiUtilDisconnect(unsigned long hCard) {
}

unsigned long gscBsiUtilBeginTransaction(unsigned long hCard, _Bool blType) {
}

unsigned long gscBsiUtilEndTransaction(unsigned long hCard) {
}

unsigned long gscBsiUtilGetVersion(unsigned char **version) {
	int sprintf_ret;

	if (version == NULL) {
		return(BSI_UNKNOWN_ERROR);
	}

	if (*version == NULL) {
		sprintf_ret = sprintf(NULL, "2,1,0,%s", PACKAGE_VERSION);

		if (sprintf_ret <= 0) {
			return(BSI_UNKNOWN_ERROR);
		}

		*version = malloc(sprintf_ret + 1);
	}

	/* Hopefully their buffer is large enough ... */
	sprintf(*version, "2,1,0,%s", PACKAGE_VERSION);

	return(BSI_OK);
}

unsigned long gscBsiUtilGetCardProperties(unsigned long hCard, unsigned char **CCCUniqueID, unsigned long *cardCapability) {
}

unsigned long gscBsiUtilGetCardStatus(unsigned long hCard) {
}

unsigned long gscBsiUtilGetExtendedErrorText(unsigned long hCard, unsigned char **errorText) {
	if (errorText == NULL) {
		return(BSI_UNKNOWN_ERROR);
	}

	*errorText = NULL;

	return(BSI_NO_TEXT_AVAILABLE);
}

unsigned long gscBsiUtilGetReaderList(unsigned char ***readerList) {
}

unsigned long gscBsiUtilPassthru(unsigned long hCard, unsigned char *cardCommand, unsigned char **cardResponse) {
}

unsigned long gscBsiUtilReleaseContext(unsigned long hCard, unsigned char *AID) {
}

unsigned long gscBsiGcDataCreate(unsigned long hCard, unsigned char *AID, unsigned char tag, unsigned char *value) {
}

unsigned long gscBsiGcDataDelete(unsigned long hCard, unsigned char *AID, unsigned char tag) {
}

unsigned long gscBsiGcGetContainerProperties(unsigned long hCard, unsigned char *AID, struct GCacr *strctGCacr, struct GCContainerSize *strctContainerSizes, unsigned char **containerVersion) {
}

unsigned long gscBsiGcReadTagList(unsigned long hCard, unsigned char *AID, unsigned char **tagArray) {
}

unsigned long gscBsiGcReadValue(unsigned long hCard, unsigned char *AID, unsigned char tag, unsigned char **value) {
}

unsigned long gscBsiGcUpdateValue(unsigned long hCard, unsigned char *AID, unsigned char tag, unsigned char *value) {
}

unsigned long gscBsiGetChallenge(unsigned long hCard, unsigned char *AID, unsigned char **challenge) {
}

unsigned long gscBsiSkiInternalAuthenticate(unsigned long hCard, unsigned char *AID, unsigned char algoID, unsigned char *challenge, unsigned char **cryptogram) {
}

unsigned long gscBsiPkiCompute(unsigned long hCard, unsigned char *AID, unsigned char algoID, unsigned char *message, unsigned char **result) {
}

unsigned long gscBsiPkiGetCertificate(unsigned long hCard, unsigned char *AID, unsigned char **Certificate) {
}

unsigned long gscBsiGetCryptoProperties(unsigned long hCard, unsigned char *AID, struct CRYPTOacr *strctCRYPTOacr, unsigned long *keyLen) {
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


































































































































































































































Deleted cackey_spm.h version [8f907a66a1].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
 * GSC-IS (v2.1) Service Call Level Service Provider Module for PC/SC Lite and
 * DoD CAC/CACv2/PIV/PIVv2 Cards
 */

/* Access ... ? */
#define BSI_AM_XAUTH                 0x02
#define BSI_AM_SECURE_CHANNEL_GP     0x04
#define BSI_AM_PIN                   0x06
#define BSI_AM_SECURE_CHANNEL_ISO    0x0B

/* Access Control Rules */
#define BSI_ACR_ALWYS                0x00
#define BSI_ACR_NEVER                0x01
#define BSI_ACR_XAUTH                0x02
#define BSI_ACR_XAUTH_OR_PIN         0x03
#define BSI_SECURE_CHANNEL_GP        0x04 /* typo in spec? */
#define BSI_ACR_SECURE_CHANNEL_GP    0x04
#define BSI_ACR_PIN_ALWAYS           0x05
#define BSI_ACR_PIN                  0x06
#define BSI_ACR_XAUTH_THEN_PIN       0x07
#define BSI_ACR_UPDATE_ONCE          0x08
#define BSI_ACR_PIN_THEN_XAUTH       0x09
#define BSI_SECURE_CHANNEL_ISO       0x0B /* typo in spec? */
#define BSI_ACR_SECURE_CHANNEL_ISO   0x0B
#define BSI_ACR_XAUTH_AND_PIN        0x0C

/* Algorithms */
#define BSI_CKM_DES3_ECB             0x81
#define BSI_CKM_DES3_CBC             0x82
#define BSI_CKM_RSA_NO_PAD           0xA3

/* Return Codes */
#define BSI_OK                       0x00
#define BSI_ACCESS_DENIED            0x01
#define BSI_ACR_NOT_AVAILABLE        0x02
#define BSI_BAD_AID                  0x03
#define BSI_BAD_ALGO_ID              0x04
#define BSI_BAD_AUTH                 0x05
#define BSI_BAD_HANDLE               0x06
#define BSI_BAD_PARAM                0x07
#define BSI_BAD_TAG                  0x08
#define BSI_CARD_ABSENT              0x09
#define BSI_CARD_REMOVED             0x0A
#define BSI_NO_SPSSERVICE            0x0B
#define BSI_IO_ERROR                 0x0C
#define BSI_INSUFFICIENT_BUFFER      0x0E
#define BSI_NO_CARDSERVICE           0x0F
#define BSI_NO_MORE_SPACE            0x10
#define BSI_PIN_BLOCKED              0x11
#define BSI_TAG_EXISTS               0x13
#define BSI_TIMEOUT_ERROR            0x14
#define BSI_TERMINAL_AUTH            0x15
#define BSI_NO_TEXT_AVAILABLE        0x16
#define BSI_UNKNOWN_ERROR            0x17
#define BSI_UNKNOWN_READER           0x18
#define BSI_SC_LOCKED                0x19
#define BSI_NOT_TRANSACTED           0x20

#define MaxNbAM 50

struct BSIAcr {
	unsigned long ACRType;
	unsigned long keyIDOrReference[MaxNbAM];
	unsigned long AuthNb;
	unsigned long ACRID;
};

struct GCacr {
	struct BSIAcr createACR;
	struct BSIAcr deleteACR;
	struct BSIAcr readTagListACR;
	struct BSIAcr readValueACR;
	struct BSIAcr updateValueACR;
};

struct GCContainerSize {
	unsigned long maxNbDataItems;
	unsigned long maxValueStorageSize;
	
};

struct CRYPTOacr {
	struct BSIAcr getChallengeACR;
	struct BSIAcr internalAuthenticateACR;
	struct BSIAcr pkiComputeACR;
	struct BSIAcr createACR;
	struct BSIAcr deleteACR;
	struct BSIAcr readTagListACR;
	struct BSIAcr readValueACR;
	struct BSIAcr updateValueACR;
};

struct BSIAuthenticator {
};

unsigned long gscBsiUtilAcquireContext(unsigned long hCard, unsigned char *AID, struct BSIAuthenticator strctAuthenticator[], unsigned long authNb);
unsigned long gscBsiUtilConnect(unsigned char *readerName, unsigned long *hCard);
unsigned long gscBsiUtilDisconnect(unsigned long hCard);
unsigned long gscBsiUtilBeginTransaction(unsigned long hCard, _Bool blType);
unsigned long gscBsiUtilEndTransaction(unsigned long hCard);
unsigned long gscBsiUtilGetVersion(unsigned char **version);
unsigned long gscBsiUtilGetCardProperties(unsigned long hCard, unsigned char **CCCUniqueID, unsigned long *cardCapability);
unsigned long gscBsiUtilGetCardStatus(unsigned long hCard);
unsigned long gscBsiUtilGetExtendedErrorText(unsigned long hCard, unsigned char **errorText);
unsigned long gscBsiUtilGetReaderList(unsigned char ***readerList);
unsigned long gscBsiUtilPassthru(unsigned long hCard, unsigned char *cardCommand, unsigned char **cardResponse);
unsigned long gscBsiUtilReleaseContext(unsigned long hCard, unsigned char *AID);
unsigned long gscBsiGcDataCreate(unsigned long hCard, unsigned char *AID, unsigned char tag, unsigned char *value);
unsigned long gscBsiGcDataDelete(unsigned long hCard, unsigned char *AID, unsigned char tag);
unsigned long gscBsiGcGetContainerProperties(unsigned long hCard, unsigned char *AID, struct GCacr *strctGCacr, struct GCContainerSize *strctContainerSizes, unsigned char **containerVersion);
unsigned long gscBsiGcReadTagList(unsigned long hCard, unsigned char *AID, unsigned char **tagArray);
unsigned long gscBsiGcReadValue(unsigned long hCard, unsigned char *AID, unsigned char tag, unsigned char **value);
unsigned long gscBsiGcUpdateValue(unsigned long hCard, unsigned char *AID, unsigned char tag, unsigned char *value);
unsigned long gscBsiGetChallenge(unsigned long hCard, unsigned char *AID, unsigned char **challenge);
unsigned long gscBsiSkiInternalAuthenticate(unsigned long hCard, unsigned char *AID, unsigned char algoID, unsigned char *challenge, unsigned char **cryptogram);
unsigned long gscBsiPkiCompute(unsigned long hCard, unsigned char *AID, unsigned char algoID, unsigned char *message, unsigned char **result);
unsigned long gscBsiPkiGetCertificate(unsigned long hCard, unsigned char *AID, unsigned char **Certificate);
unsigned long gscBsiGetCryptoProperties(unsigned long hCard, unsigned char *AID, struct CRYPTOacr *strctCRYPTOacr, unsigned long *keyLen);
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<