1
0
mirror of https://github.com/opencryptoki/opencryptoki.git synced 2026-10-24 05:39:17 +03:00

Set sane defaults for library,slot and token information

Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com>
This commit is contained in:
Patrick Steuer
2020-04-03 11:27:55 +02:00
parent 4ccc9a35a6
commit 5d3d1e03e9
9 changed files with 30 additions and 31 deletions

View File

@@ -228,7 +228,7 @@ typedef Slot_Info_t SLOT_INFO;
// Call to populate the shared memory
#define STR "01234567890123456789012345678901"
#define MFG "IBM "
#define LIB "Meta PKCS11 LIBRARY "
#define LIB "openCryptoki "
#define MAJOR_V 1

View File

@@ -64,10 +64,10 @@
#define POINT_CONVERSION_HYBRID 0x06
const char manuf[] = "IBM Corp.";
const char model[] = "IBM CCA Token";
const char descr[] = "IBM PKCS#11 CCA Token";
const char label[] = "IBM PKCS#11 for CCA";
const char manuf[] = "IBM";
const char model[] = "CCA";
const char descr[] = "IBM CCA Token";
const char label[] = "ccatok";
#define CCASHAREDLIB "libcsulcca.so"

View File

@@ -474,9 +474,8 @@ void init_tokenInfo(TOKEN_DATA *nv_token_data)
memcpy(token_info->manufacturerID, manuf, strlen(manuf));
memcpy(token_info->model, model, strlen(model));
// use the 41-xxxxx serial number from the coprocessor
//
memcpy(token_info->serialNumber, "123", 3);
// Unused
// memcpy(token_info->serialNumber, "123", 3);
// I don't see any API support for changing the clock so
// we will use the system clock for the token's clock.
@@ -507,9 +506,9 @@ void init_tokenInfo(TOKEN_DATA *nv_token_data)
token_info->ulTotalPrivateMemory = (CK_ULONG_32) CK_UNAVAILABLE_INFORMATION;
token_info->ulFreePrivateMemory = (CK_ULONG_32) CK_UNAVAILABLE_INFORMATION;
token_info->hardwareVersion.major = 1;
token_info->hardwareVersion.major = 0;
token_info->hardwareVersion.minor = 0;
token_info->firmwareVersion.major = 1;
token_info->firmwareVersion.major = 0;
token_info->firmwareVersion.minor = 0;
}

View File

@@ -169,10 +169,10 @@ static inline void hexdump(void *buf, size_t buflen)
#endif /* DEBUG */
const char manuf[] = "IBM Corp.";
const char model[] = "IBM EP11Tok ";
const char descr[] = "IBM PKCS#11 EP11 token";
const char label[] = "IBM OS PKCS#11 ";
const char manuf[] = "IBM";
const char model[] = "EP11";
const char descr[] = "IBM EP11 token";
const char label[] = "ep11tok";
/* largest blobsize ever seen is about 5k (for 4096 mod bits RSA keys) */
#define MAX_BLOBSIZE 8192

View File

@@ -61,10 +61,10 @@ typedef struct {
#define MAX_GENERIC_KEY_SIZE 256
const char manuf[] = "IBM Corp.";
const char model[] = "IBM ICA ";
const char descr[] = "IBM PKCS#11 ICA token ";
const char label[] = "IBM ICA PKCS #11";
const char manuf[] = "IBM";
const char model[] = "ICA";
const char descr[] = "IBM ICA token";
const char label[] = "icatok";
static pthread_mutex_t rngmtx = PTHREAD_MUTEX_INITIALIZER;

View File

@@ -46,10 +46,10 @@
#include "slotmgr.h"
/* Default token attributes */
const char manuf[] = "IBM Corp.";
const char model[] = "IBM ICSFTok ";
const char descr[] = "IBM PKCS#11 ICSF token";
const char label[] = "IBM OS PKCS#11 ";
const char manuf[] = "IBM";
const char model[] = "ICSF";
const char descr[] = "IBM ICSF token";
const char label[] = "icsftok";
/* mechanisms provided by this token */
static const MECH_LIST_ELEMENT icsf_mech_list[] = {

View File

@@ -59,10 +59,10 @@
#define MAX_GENERIC_KEY_SIZE 256
const char manuf[] = "IBM Corp.";
const char model[] = "IBM SoftTok ";
const char descr[] = "IBM PKCS#11 Soft token";
const char label[] = "IBM OS PKCS#11 ";
const char manuf[] = "IBM";
const char model[] = "Soft";
const char descr[] = "IBM Soft token";
const char label[] = "softtok";
static const MECH_LIST_ELEMENT soft_mech_list[] = {
{CKM_RSA_PKCS_KEY_PAIR_GEN, {512, 4096, CKF_GENERATE_KEY_PAIR}},

View File

@@ -93,10 +93,10 @@ typedef struct {
TSS_RESULT util_set_public_modulus(TSS_HCONTEXT tspContext, TSS_HKEY,
unsigned long, unsigned char *);
const char manuf[] = "IBM Corp.";
const char model[] = "TPM v1.1 Token";
const char descr[] = "Token for the Trusted Platform Module";
const char label[] = "IBM PKCS#11 TPM Token";
const char manuf[] = "IBM";
const char model[] = "TPM";
const char descr[] = "IBM TPM v1.1 token";
const char label[] = "tpmtok";
static const MECH_LIST_ELEMENT tpm_mech_list[] = {
{CKM_RSA_PKCS_KEY_PAIR_GEN, {512, 2048, CKF_GENERATE_KEY_PAIR}},

View File

@@ -575,7 +575,7 @@ CK_RV display_pkcs11_info(void)
printf("\tManufacturer: %.32s \n", CryptokiInfo.manufacturerID);
printf("\tFlags: 0x%lX \n", CryptokiInfo.flags);
printf("\tLibrary Description: %.32s \n", CryptokiInfo.libraryDescription);
printf("\tLibrary Version %d.%d \n", CryptokiInfo.libraryVersion.major,
printf("\tLibrary Version: %d.%d \n", CryptokiInfo.libraryVersion.major,
CryptokiInfo.libraryVersion.minor);
return rc;