summaryrefslogtreecommitdiff
path: root/doc/pkcs11-coverage.txt
blob: 288591598a9cc7b4cf46b5e5998e9e50eb66dc66 (plain)
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187


PKCS#11 COVERAGE

This is the test coverage of the p11-tests tool of the PKCS#11 interface.
We're anxious to complete this, if you have patches please do contribute.


C_CloseAllSessions
- Invalid slot id
- Normal call
- Check open session was closed
- Call when no sessions open

C_CloseSession
- Invalid session
- Normal call
- Check open session was closed
- Close twice

C_CopyObject
- Not Implemented

C_CreateObject
- Not Implemented

C_Decrypt
- CKM_RSA_PKCS
- CKM_RSA_X_509

C_DestroyObject
- Not Implemented

C_Encrypt
- CKM_RSA_PKCS
- CKM_RSA_X_509

C_Finalize
- With invalid argument
- Normal call
- Double finalize in a row

C_FindObjects
- Invalid session
- Null object count
- Retrieve a single object before remainder
- Retrieve remaining objects
- Extra call after retrieving all objects.
- Out of order call

C_FindObjectsFinal
- Invalid session
- Normal call
- Extra call

C_FindObjectsInit
- Invalid session
- Attribute count without buffer
- Double call.

C_GetAttributeValue
- Invalid session
- Invalid object
- No template
- Buffer too small
- Retrieve attribute length
- Retrieve single attribute
- With one invalid attribute, no buffer.
- With one invalid attribute, with buffer.
- Multiple attributes, no buffer.
- Multiple attributes, some buffers
- Multiple attributes, one small buffer
- Multiple attributes, with buffers

C_GetFunctionList
- See if returns same data as library entry point

C_GetInfo
- NULL argument
- Normal call
- Space padded strings in CK_INFO
- No flags set

C_GetMechanismInfo
- Invalid mechanism
- Null arguments
- Invalid slot id
- Normal call

C_GetMechanismList
- Null arguments
- Without buffer
- Zero count but buffer present
- Low count but buffer present

C_GetObjectSize
- Not Implemented

C_GetOperationState
- Not Implemented

C_GetSessionInfo
- Invalid session
- NULL arguments
- Valid call
- Valid slot id
- Valid state for session
- Valid flags for session

C_GetSlotInfo
- NULL argument
- Normal call
- Space padded CK_SLOT_INFO fields
- CK_SLOT_INFO flags are from valid set
- Track CKF_TOKEN_PRESENT flag and compare to C_GetSlotList(TRUE)

C_GetSlotList
- NULL arguments
- Retrieving the count
- Passing buffer space along with zero count.
- Passing buffer space along with low count.
- Passing too much buffer space.

C_GetTokenInfo
- Null arguments
- Normal call
- Space padded CK_TOKEN_INFO fields
- CK_TOKEN_INFO flags are from valid set
- Validate token time when CKF_CLOCK_ON_TOKEN
- Calling on slot without token

C_InitPIN
- Not Implemented

C_InitToken
- Not Implemented

C_Initialize
- Normal call
- Locking: no threads
- Locking: os locking
- Locking: app locking
- Locking: either locking
- Calls without initializing
- NULL argument
- Multiple initialize with C_Finalize between
- Double initialize in a row

C_Login
- Invalid session
- Invalid user type
- Normal login
- Login changes all session state
- Login as SO not allowed with RO session
- Login as SO
- Login changes all session state
- Can't open RO session when logged in as SO
- Logout from SO
- Logout SO changes goes back to public

C_Logout
- Invalid session
- Normal logout
- Logout changes all session state

C_OpenSession
- Invalid slot
- Null arguments
- No flags
- Without serial flag
- Valid flags
- Read write session

C_SetOperationState
- Not Implemented

C_SetPIN
- Not Implemented

C_Sign
- CKM_RSA_PKCS (SHA1)
- CKM_RSA_PKCS (MD5)
- CKM_RSA_PKCS (SHA1/MD5/SSL3)

C_WaitForSlotEvent
- Not Implemented