summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2008-12-23 20:46:26 +0000
committerStef Walter <stef@memberwebs.com>2008-12-23 20:46:26 +0000
commit0737b441028a761dab7246ca32cb7d494d5c2f22 (patch)
treecace849e1c6144918a50c96f3f9ff09247f93545
parentcd91ec0ef91028fb7e42cfaeab58bca46b8ca972 (diff)
Support virtual slots, context specific logins, and other fixes.
-rw-r--r--src/key.c29
-rw-r--r--src/object.c29
-rw-r--r--src/p11-tests.h6
-rw-r--r--src/rsa.c40
-rw-r--r--src/session.c72
-rw-r--r--src/slot.c17
-rw-r--r--src/test-data.c260
7 files changed, 351 insertions, 102 deletions
diff --git a/src/key.c b/src/key.c
index 0d2826e..0fa4c4b 100644
--- a/src/key.c
+++ b/src/key.c
@@ -575,3 +575,32 @@ p11t_key_export_public_rsa(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key)
return rsa;
}
+CK_RV
+p11t_key_login_context_specific (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key)
+{
+ CK_SESSION_INFO info;
+ CK_ATTRIBUTE attr;
+ CK_BBOOL always;
+ CK_UTF8CHAR_PTR pin;
+ CK_ULONG n_pin;
+ CK_RV rv;
+
+ assert(session != CK_INVALID);
+ assert(p11t_module_funcs);
+
+ attr.type = CKA_ALWAYS_AUTHENTICATE;
+ attr.ulValueLen = sizeof (always);
+ attr.pValue = &always;
+
+ if (!p11t_object_get (session, key, &attr, 1) || !always) {
+ p11t_check_fail ("Key wants context specific login, but CKA_ALWAYS_AUTHENTICATE not set");
+ return CKR_ATTRIBUTE_VALUE_INVALID;
+ }
+
+ rv = (p11t_module_funcs->C_GetSessionInfo)(session, &info);
+ if (rv != CKR_OK)
+ return rv;
+
+ pin = p11t_session_get_pin (info.slotID, CKU_CONTEXT_SPECIFIC, &n_pin);
+ return (p11t_module_funcs->C_Login)(session, CKU_CONTEXT_SPECIFIC, pin, n_pin);
+}
diff --git a/src/object.c b/src/object.c
index c0b8aa6..accb444 100644
--- a/src/object.c
+++ b/src/object.c
@@ -85,8 +85,10 @@ test_find_objects(CK_SESSION_HANDLE session)
{
CK_OBJECT_HANDLE objects[1024];
CK_OBJECT_HANDLE extra;
- CK_ATTRIBUTE dummy;
- CK_ULONG object_count, count;
+ CK_ATTRIBUTE attr;
+ CK_SESSION_INFO sinfo;
+ CK_ULONG object_count, count, i;
+ CK_BBOOL is_private;
CK_RV rv;
assert(p11t_module_funcs);
@@ -95,7 +97,7 @@ test_find_objects(CK_SESSION_HANDLE session)
if(p11t_test_unexpected)
{
- rv = (p11t_module_funcs->C_FindObjectsInit)((CK_SESSION_HANDLE)-99, &dummy, 0);
+ rv = (p11t_module_funcs->C_FindObjectsInit)((CK_SESSION_HANDLE)-99, &attr, 0);
P11T_CHECK_RV("Invalid session", rv, CKR_SESSION_HANDLE_INVALID);
rv = (p11t_module_funcs->C_FindObjectsInit)(session, NULL, 1);
@@ -103,12 +105,12 @@ test_find_objects(CK_SESSION_HANDLE session)
}
- rv = (p11t_module_funcs->C_FindObjectsInit)(session, &dummy, 0);
+ rv = (p11t_module_funcs->C_FindObjectsInit)(session, &attr, 0);
P11T_CHECK_RV("Find all objects", rv, CKR_OK);
if(p11t_test_unexpected)
{
- rv = (p11t_module_funcs->C_FindObjectsInit)(session, &dummy, 0);
+ rv = (p11t_module_funcs->C_FindObjectsInit)(session, &attr, 0);
P11T_CHECK_RV("Double call", rv, CKR_OPERATION_ACTIVE);
}
@@ -136,6 +138,23 @@ test_find_objects(CK_SESSION_HANDLE session)
}
while(count == 1024);
+ /* Get the session state */
+ rv = (p11t_module_funcs->C_GetSessionInfo) (session, &sinfo);
+ P11T_CHECK_RV("Check private objects not found in public session", rv, CKR_OK);
+
+ /* Check that they're not private, if the session is logged in */
+ if (sinfo.state == CKS_RO_PUBLIC_SESSION || sinfo.state == CKS_RW_PUBLIC_SESSION) {
+ for (i = 0; i < count; ++i) {
+ attr.type = CKA_PRIVATE;
+ attr.ulValueLen = sizeof (is_private);
+ attr.pValue = &is_private;
+ rv = (p11t_module_funcs->C_GetAttributeValue) (session, objects[i], &attr, 1);
+ P11T_CHECK_RV("Check private objects not found in public session", rv, CKR_OK);
+ if (is_private)
+ P11T_CHECK_FAIL("Check private objects not found in public session");
+ }
+ }
+
if(p11t_test_unexpected)
{
rv = (p11t_module_funcs->C_FindObjects(session, &extra, 1, &count));
diff --git a/src/p11-tests.h b/src/p11-tests.h
index 4ab508d..2bf4c53 100644
--- a/src/p11-tests.h
+++ b/src/p11-tests.h
@@ -120,6 +120,8 @@ CK_OBJECT_HANDLE p11t_key_get_private(CK_SESSION_HANDLE session, CK_OBJECT_HANDL
RSA* p11t_key_export_public_rsa(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key);
+CK_RV p11t_key_login_context_specific (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key);
+
void p11t_key_tests(void);
/* -------------------------------------------------------------------
@@ -183,6 +185,7 @@ int p11t_session_login(CK_SESSION_HANDLE handle);
int p11t_session_logout(CK_SESSION_HANDLE handle);
int p11t_session_close(CK_SESSION_HANDLE handle);
int p11t_session_close_all(CK_SLOT_ID slot);
+CK_UTF8CHAR_PTR p11t_session_get_pin(CK_SLOT_ID slot, CK_USER_TYPE user, CK_ULONG_PTR n_pin);
void p11t_session_config(const char *name, const char *value);
@@ -193,6 +196,7 @@ void p11t_session_tests(void);
*/
extern CK_ULONG p11t_slot_count;
+extern int p11t_slot_virtual;
void p11t_slot_tests(void);
@@ -213,7 +217,7 @@ CK_MECHANISM_INFO_PTR p11t_slot_get_mech_info(CK_SLOT_ID slot, CK_MECHANISM_TYPE
* test-data.c
*/
-#define P11T_BLOCK 1024
+#define P11T_BLOCK 10240
extern const CK_BYTE p11t_test_data[];
extern const CK_ULONG p11t_test_data_size;
extern const CK_ULONG p11t_test_data_bits;
diff --git a/src/rsa.c b/src/rsa.c
index fa3d372..076e514 100644
--- a/src/rsa.c
+++ b/src/rsa.c
@@ -63,6 +63,16 @@ test_rsa_decrypt(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key,
n_decrypted = sizeof(decrypted);
rv = (p11t_module_funcs->C_Decrypt)(session, encrypted, n_encrypted, decrypted, &n_decrypted);
+
+ /* Requires authentication */
+ if (rv == CKR_USER_NOT_LOGGED_IN) {
+ rv = p11t_key_login_context_specific (session, key);
+ P11T_CHECK_RV("Always authenticate", rv, CKR_OK);
+
+ /* Try it again */
+ rv = (p11t_module_funcs->C_Decrypt)(session, encrypted, n_encrypted, decrypted, &n_decrypted);
+ }
+
P11T_CHECK_RV("Normal call", rv, CKR_OK);
if(n_decrypted != n_data)
@@ -164,6 +174,16 @@ test_rsa_pkcs_sign_hash(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key,
n_sig = sizeof(sig);
rv = (p11t_module_funcs->C_Sign)(session, hash, n_hash, sig, &n_sig);
+
+ /* Requires authentication */
+ if (rv == CKR_USER_NOT_LOGGED_IN) {
+ rv = p11t_key_login_context_specific (session, key);
+ P11T_CHECK_RV("Always authenticate", rv, CKR_OK);
+
+ /* Try it again */
+ rv = (p11t_module_funcs->C_Sign)(session, hash, n_hash, sig, &n_sig);
+ }
+
P11T_CHECK_RV("Normal call", rv, CKR_OK);
/* Hash the data again this time without wrapping */
@@ -207,6 +227,16 @@ test_rsa_x509_sign(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key, RSA* rsa)
n_sig = sizeof(sig);
rv = (p11t_module_funcs->C_Sign)(session, (CK_BYTE*)data, n_data, sig, &n_sig);
+
+ /* Requires authentication */
+ if (rv == CKR_USER_NOT_LOGGED_IN) {
+ rv = p11t_key_login_context_specific (session, key);
+ P11T_CHECK_RV("Always authenticate", rv, CKR_OK);
+
+ /* Try it again */
+ rv = (p11t_module_funcs->C_Sign)(session, (CK_BYTE*)data, n_data, sig, &n_sig);
+ }
+
P11T_CHECK_RV("RSA X509 Call", rv, CKR_OK);
P11T_CHECK_ULONG("C_Sign: rsa x509 result length", n_sig, size);
@@ -351,6 +381,16 @@ test_rsa_encrypt(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE key,
n_check = sizeof(check);
rv = (p11t_module_funcs->C_Decrypt)(session, encrypted, n_encrypted, check, &n_check);
+
+ /* Requires authentication */
+ if (rv == CKR_USER_NOT_LOGGED_IN) {
+ rv = p11t_key_login_context_specific (session, privkey);
+ P11T_CHECK_RV("Always authenticate", rv, CKR_OK);
+
+ /* Try it again */
+ rv = (p11t_module_funcs->C_Decrypt)(session, encrypted, n_encrypted, check, &n_check);
+ }
+
P11T_CHECK_RV("Module encrypted data", rv, CKR_OK);
if(n_check != n_data)
diff --git a/src/session.c b/src/session.c
index 1ed0104..20524b9 100644
--- a/src/session.c
+++ b/src/session.c
@@ -5,7 +5,7 @@
static const char *login_user_pin = NULL;
static const char *login_so_pin = NULL;
-
+static const char *login_context_pin = NULL;
void
p11t_session_config(const char *name, const char *value)
@@ -14,6 +14,8 @@ p11t_session_config(const char *name, const char *value)
login_user_pin = value;
if(strcmp(name, "login-so-pin") == 0)
login_so_pin = value;
+ if(strcmp(name, "login-context-pin") == 0)
+ login_context_pin = value;
}
/* ----------------------------------------------------------------------------------
@@ -52,31 +54,6 @@ test_session_info(CK_SESSION_HANDLE session, CK_SLOT_ID slot, CK_FLAGS flags, CK
return CONTINUE;
}
-static CK_UTF8CHAR_PTR
-calculate_pin(CK_SLOT_ID slot, CK_USER_TYPE user, CK_ULONG_PTR n_pin)
-{
- CK_TOKEN_INFO_PTR info;
- const char *pin;
-
- *n_pin = 0;
-
- info = p11t_slot_get_token_info(slot);
- if(info && info->flags & CKF_PROTECTED_AUTHENTICATION_PATH)
- return NULL;
-
- if(user == CKU_USER)
- pin = login_user_pin;
- else if(user == CKU_SO)
- pin = login_so_pin;
- else
- pin = NULL;
-
- if(pin)
- *n_pin = (CK_ULONG)strlen(pin);
-
- return (CK_UTF8CHAR_PTR)pin;
-}
-
static int
test_session_user_login(CK_SLOT_ID slot)
{
@@ -86,7 +63,7 @@ test_session_user_login(CK_SLOT_ID slot)
CK_ULONG n_pin;
CK_RV rv;
- pin = calculate_pin(slot, CKU_USER, &n_pin);
+ pin = p11t_session_get_pin (slot, CKU_USER, &n_pin);
rv = (p11t_module_funcs->C_OpenSession)(slot, CKF_SERIAL_SESSION, NULL, NULL, &session_ro);
P11T_CHECK_RV("C_Login: open RO session", rv, CKR_OK);
@@ -144,7 +121,7 @@ test_session_so_login(CK_SLOT_ID slot)
CK_ULONG n_pin;
CK_RV rv;
- pin = calculate_pin(slot, CKU_SO, &n_pin);
+ pin = p11t_session_get_pin (slot, CKU_SO, &n_pin);
rv = (p11t_module_funcs->C_OpenSession)(slot, CKF_SERIAL_SESSION | CKF_RW_SESSION, NULL, NULL, &session_rw);
P11T_CHECK_RV("C_OpenSession: open RW session", rv, CKR_OK);
@@ -210,8 +187,11 @@ test_session_main(CK_SLOT_ID slot)
if(p11t_test_unexpected)
{
- rv = (p11t_module_funcs->C_OpenSession)((CK_SLOT_ID)-5, CKF_SERIAL_SESSION, NULL, NULL, &session_ro);
- P11T_CHECK_RV("Invalid slot", rv, CKR_SLOT_ID_INVALID);
+ if (!p11t_slot_virtual)
+ {
+ rv = (p11t_module_funcs->C_OpenSession)((CK_SLOT_ID)-5, CKF_SERIAL_SESSION, NULL, NULL, &session_ro);
+ P11T_CHECK_RV("Invalid slot", rv, CKR_SLOT_ID_INVALID);
+ }
rv = (p11t_module_funcs->C_OpenSession)(slot, CKF_SERIAL_SESSION, NULL, NULL, NULL);
P11T_CHECK_RV("Null arguments", rv, CKR_ARGUMENTS_BAD);
@@ -276,7 +256,7 @@ test_session_main(CK_SLOT_ID slot)
P11T_SECTION("C_CloseAllSessions");
- if(p11t_test_unexpected)
+ if(p11t_test_unexpected && !p11t_slot_virtual)
{
rv = (p11t_module_funcs->C_CloseAllSessions)((CK_SLOT_ID)-34);
P11T_CHECK_RV("Invalid slot id", rv, CKR_SLOT_ID_INVALID);
@@ -359,6 +339,34 @@ p11t_session_open(CK_SLOT_ID slot, int readwrite)
return session;
}
+CK_UTF8CHAR_PTR
+p11t_session_get_pin(CK_SLOT_ID slot, CK_USER_TYPE user, CK_ULONG_PTR n_pin)
+{
+ CK_TOKEN_INFO_PTR info;
+ const char *pin;
+
+ *n_pin = 0;
+
+ info = p11t_slot_get_token_info(slot);
+ if(info && info->flags & CKF_PROTECTED_AUTHENTICATION_PATH)
+ return NULL;
+
+ if(user == CKU_USER)
+ pin = login_user_pin;
+ else if(user == CKU_SO)
+ pin = login_so_pin;
+ else if(user == CKU_CONTEXT_SPECIFIC)
+ pin = login_context_pin;
+ else
+ pin = NULL;
+
+ if(pin)
+ *n_pin = (CK_ULONG)strlen(pin);
+
+ return (CK_UTF8CHAR_PTR)pin;
+}
+
+
int
p11t_session_login(CK_SESSION_HANDLE session)
{
@@ -380,7 +388,7 @@ p11t_session_login(CK_SESSION_HANDLE session)
return 1;
}
- pin = calculate_pin(info.slotID, CKU_USER, &n_pin);
+ pin = p11t_session_get_pin(info.slotID, CKU_USER, &n_pin);
if((p11t_module_funcs->C_Login)(session, CKU_USER, pin, n_pin) != CKR_OK)
return 0;
diff --git a/src/slot.c b/src/slot.c
index ea4bf15..48addca 100644
--- a/src/slot.c
+++ b/src/slot.c
@@ -7,6 +7,7 @@
CK_INFO slot_global;
+int p11t_slot_virtual = 0;
CK_ULONG p11t_slot_count = 0;
static CK_SLOT_ID_PTR slot_ids = NULL;
static CK_SLOT_INFO_PTR slot_info = NULL;
@@ -16,6 +17,9 @@ static CK_ULONG *slot_mech_count;
static CK_MECHANISM_TYPE_PTR *slot_mech_type;
static CK_MECHANISM_INFO_PTR *slot_mech_info;
+/* TODO: Get this from a header */
+#define CKF_VIRTUAL_SLOTS 0x40000000
+
/* ----------------------------------------------------------------------------------
* TESTS
*/
@@ -46,7 +50,9 @@ test_slot_global(void)
P11T_CHECK_PADDED("manufacturerID", slot_global.manufacturerID);
P11T_CHECK_PADDED("libraryDescription", slot_global.libraryDescription);
- P11T_CHECK_ULONG("flags", slot_global.flags, 0);
+ P11T_CHECK_ULONG("flags", slot_global.flags, CKF_VIRTUAL_SLOTS);
+ if (slot_global.flags & CKF_VIRTUAL_SLOTS)
+ p11t_slot_virtual = 1;
return CONTINUE;
}
@@ -266,7 +272,7 @@ test_slot_mechanisms(void)
if(!p11t_slot_count)
return CONTINUE;
- if(p11t_test_unexpected)
+ if(p11t_test_unexpected && !p11t_slot_virtual)
{
mech_count = 0;
rv = (p11t_module_funcs->C_GetMechanismList)((CK_ULONG)-10, NULL, &mech_count);
@@ -341,8 +347,11 @@ test_slot_mechanisms(void)
rv = (p11t_module_funcs->C_GetMechanismInfo)(slot_id, mech_list[0], NULL);
P11T_CHECK_RV("Null arguments", rv, CKR_ARGUMENTS_BAD);
- rv = (p11t_module_funcs->C_GetMechanismInfo)((CK_ULONG)-11, mech_list[0], mech_info);
- P11T_CHECK_RV("Invalid slot id", rv, CKR_SLOT_ID_INVALID);
+ if (!p11t_slot_virtual)
+ {
+ rv = (p11t_module_funcs->C_GetMechanismInfo)((CK_ULONG)-11, mech_list[0], mech_info);
+ P11T_CHECK_RV("Invalid slot id", rv, CKR_SLOT_ID_INVALID);
+ }
}
for(j = 0; j < mech_count; ++j)
diff --git a/src/test-data.c b/src/test-data.c
index 4a05230..a81b0ed 100644
--- a/src/test-data.c
+++ b/src/test-data.c
@@ -2,66 +2,206 @@
#include "p11-tests.h"
const CK_BYTE p11t_test_data[] =
- "0123456789ABCD 1" \
- "0123456789ABCD 2" \
- "0123456789ABCD 3" \
- "0123456789ABCD 4" \
- "0123456789ABCD 5" \
- "0123456789ABCD 6" \
- "0123456789ABCD 7" \
- "0123456789ABCD 8" \
- "0123456789ABCD 9" \
- "0123456789ABCD A" \
- "0123456789ABCD B" \
- "0123456789ABCD C" \
- "0123456789ABCD D" \
- "0123456789ABCD E" \
- "0123456789ABCD F" \
- "0123456789ABCD 1" \
- "0123456789ABCD 2" \
- "0123456789ABCD 3" \
- "0123456789ABCD 4" \
- "0123456789ABCD 5" \
- "0123456789ABCD 6" \
- "0123456789ABCD 7" \
- "0123456789ABCD 8" \
- "0123456789ABCD 9" \
- "0123456789ABCD A" \
- "0123456789ABCD B" \
- "0123456789ABCD C" \
- "0123456789ABCD D" \
- "0123456789ABCD E" \
- "0123456789ABCD F" \
- "0123456789ABCD 1" \
- "0123456789ABCD 2" \
- "0123456789ABCD 3" \
- "0123456789ABCD 4" \
- "0123456789ABCD 5" \
- "0123456789ABCD 6" \
- "0123456789ABCD 7" \
- "0123456789ABCD 8" \
- "0123456789ABCD 9" \
- "0123456789ABCD A" \
- "0123456789ABCD B" \
- "0123456789ABCD C" \
- "0123456789ABCD D" \
- "0123456789ABCD E" \
- "0123456789ABCD F" \
- "0123456789ABCD 1" \
- "0123456789ABCD 2" \
- "0123456789ABCD 3" \
- "0123456789ABCD 4" \
- "0123456789ABCD 5" \
- "0123456789ABCD 6" \
- "0123456789ABCD 7" \
- "0123456789ABCD 8" \
- "0123456789ABCD 9" \
- "0123456789ABCD A" \
- "0123456789ABCD B" \
- "0123456789ABCD C" \
- "0123456789ABCD D" \
- "0123456789ABCD E" \
- "0123456789ABCD F";
+
+ /* 0 KB */
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+
+ /* 1 KB */
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+
+ /* 2 KB */
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+
+ /* 3 KB */
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+
+ /* 4 KB */
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+
+ /* 5 KB */
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+
+ /* 6 KB */
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+
+ /* 7 KB */
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+
+ /* 8 KB */
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+
+ /* 9 KB */
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+
+ /* 10 KB */
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+ "0123456789ABCD 0" "0123456789ABCD 1" "0123456789ABCD 2" "0123456789ABCD 3" \
+ "0123456789ABCD 4" "0123456789ABCD 5" "0123456789ABCD 6" "0123456789ABCD 7" \
+ "0123456789ABCD 8" "0123456789ABCD 9" "0123456789ABCD A" "0123456789ABCD B" \
+ "0123456789ABCD C" "0123456789ABCD D" "0123456789ABCD E" "0123456789ABCD F" \
+
+ ;
const CK_ULONG p11t_test_data_size = P11T_BLOCK;
const CK_ULONG p11t_test_data_bits = P11T_BLOCK * 8;