Drop the wrapping of structure, and mark the whole thing constant to at
least go into .data.rel.ro.
---
usr/lib/pkcs11/api/apiutil.c | 2 +-
usr/lib/pkcs11/api/msg.h | 396 +++++++++++++++++------------------
usr/lib/pkcs11/cca_stdll/h_extern.h | 2 +-
usr/lib/pkcs11/common/h_extern.h | 2 +-
usr/lib/pkcs11/common/log.c | 392 +++++++++++++++++-----------------
usr/lib/pkcs11/common/msg.h | 6 +-
6 files changed, 396 insertions(+), 404 deletions(-)
diff --git a/usr/lib/pkcs11/api/apiutil.c b/usr/lib/pkcs11/api/apiutil.c
index 082cfa8..30e2f73 100644
--- a/usr/lib/pkcs11/api/apiutil.c
+++ b/usr/lib/pkcs11/api/apiutil.c
@@ -1129,7 +1129,7 @@ st_err_log(int num, ...)
if ( enabled ){
va_start(pvar, num);
- vsprintf(buffer,err_msg[num].msg,pvar);
+ vsprintf(buffer,err_msg[num],pvar);
va_end(pvar);
syslog(LOG_ERR,buffer);
}
diff --git a/usr/lib/pkcs11/api/msg.h b/usr/lib/pkcs11/api/msg.h
index 2632eb0..d796af7 100644
--- a/usr/lib/pkcs11/api/msg.h
+++ b/usr/lib/pkcs11/api/msg.h
@@ -296,242 +296,238 @@
// File: msg.h
// Error Messages used by st_err_log
-struct messages {
- char * msg;
-};
-
-struct messages err_msg[]={
- {"%s:%d Malloc Failed"},
- {"%s:%d Not Enough Memory in Context"},
- {"%s:%d Slot Invalid"},
- {"%s:%d General Error"},
- {"%s:%d %s Function Failed"},
+const char *const err_msg[]={
+ "%s:%d Malloc Failed",
+ "%s:%d Not Enough Memory in Context",
+ "%s:%d Slot Invalid",
+ "%s:%d General Error",
+ "%s:%d %s Function Failed",
//#5
- {"%s:%d %s Bad Arguments"},
- {"%s:%d No Event"},
- {"%s:%d Attribute Read Only"},
- {"%s:%d Attribute Type Invalid"},
- {"%s:%d Attribute Value Invalid"},
+ "%s:%d %s Bad Arguments",
+ "%s:%d No Event",
+ "%s:%d Attribute Read Only",
+ "%s:%d Attribute Type Invalid",
+ "%s:%d Attribute Value Invalid",
//#10
- {"%s:%d Data Invalid"},
- {"%s:%d Data Length out of Range"},
- {"%s:%d Device Error"},
- {"%s:%d Device Removed"},
- {"%s:%d Encrypted Data Invalid"},
+ "%s:%d Data Invalid",
+ "%s:%d Data Length out of Range",
+ "%s:%d Device Error",
+ "%s:%d Device Removed",
+ "%s:%d Encrypted Data Invalid",
//15
- {"%s:%d Encrypted Data Length out of Range"},
- {"%s:%d Function Cancelled"},
- {"%s:%d Function Not Parallel"},
- {"%s:%d Key Handle Invalid"},
- {"%s:%d Key Size out of Range"},
+ "%s:%d Encrypted Data Length out of Range",
+ "%s:%d Function Cancelled",
+ "%s:%d Function Not Parallel",
+ "%s:%d Key Handle Invalid",
+ "%s:%d Key Size out of Range",
//20
- {"%s:%d Key Type Inconsistent"},
- {"%s:%d Key Not Needed"},
- {"%s:%d Key Changed"},
- {"%s:%d Key Needed"},
- {"%s:%d Key Indigestible"},
+ "%s:%d Key Type Inconsistent",
+ "%s:%d Key Not Needed",
+ "%s:%d Key Changed",
+ "%s:%d Key Needed",
+ "%s:%d Key Indigestible",
//25
- {"%s:%d Key Function Not Permitted"},
- {"%s:%d Key Not Wrappable"},
- {"%s:%d Key Unextractable"},
- {"%s:%d Mechanism Invalid"},
- {"%s:%d Mechanism Param Invalid"},
+ "%s:%d Key Function Not Permitted",
+ "%s:%d Key Not Wrappable",
+ "%s:%d Key Unextractable",
+ "%s:%d Mechanism Invalid",
+ "%s:%d Mechanism Param Invalid",
//30
- {"%s:%d Object Handle Invalid"},
- {"%s:%d Operation Active"},
- {"%s:%d Operation Not Initialized"},
- {"%s:%d Pin Incorrect"},
- {"%s:%d Pin Invalid"},
+ "%s:%d Object Handle Invalid",
+ "%s:%d Operation Active",
+ "%s:%d Operation Not Initialized",
+ "%s:%d Pin Incorrect",
+ "%s:%d Pin Invalid",
//35
- {"%s:%d Pin Length out of Range"},
- {"%s:%d Pin Expired"},
- {"%s:%d Pin Locked"},
- {"%s:%d Session Closed"},
- {"%s:%d Session Count"},
+ "%s:%d Pin Length out of Range",
+ "%s:%d Pin Expired",
+ "%s:%d Pin Locked",
+ "%s:%d Session Closed",
+ "%s:%d Session Count",
//40
- {"%s:%d Session Handle Invalid"},
- {"%s:%d Parallel Session Not Supported"},
- {"%s:%d Session Read Only"},
- {"%s:%d Session Exists"},
- {"%s:%d Session Read only Exists"},
+ "%s:%d Session Handle Invalid",
+ "%s:%d Parallel Session Not Supported",
+ "%s:%d Session Read Only",
+ "%s:%d Session Exists",
+ "%s:%d Session Read only Exists",
//45
- {"%s:%d Session Read Write Exists"},
- {"%s:%d Signature Length out of Range"},
- {"%s:%d Signature Invalid"},
- {"%s:%d Template Incomplete"},
- {"%s:%d Template Inconsistent"},
+ "%s:%d Session Read Write Exists",
+ "%s:%d Signature Length out of Range",
+ "%s:%d Signature Invalid",
+ "%s:%d Template Incomplete",
+ "%s:%d Template Inconsistent",
//50
- {"%s:%d Token Not Present"},
- {"%s:%d Token Not Recognized"},
- {"%s:%d Token Write Protected"},
- {"%s:%d Unwrapping Key Handle Invalid"},
- {"%s:%d Unwrapping Key Size Range Invalid"},
+ "%s:%d Token Not Present",
+ "%s:%d Token Not Recognized",
+ "%s:%d Token Write Protected",
+ "%s:%d Unwrapping Key Handle Invalid",
+ "%s:%d Unwrapping Key Size Range Invalid",
//55
- {"%s:%d Unwrapping Key Type Inconsistent"},
- {"%s:%d User Already Logged In"},
- {"%s:%d User Not Logged In"},
- {"%s:%d User PIN Not Initialized"},
- {"%s:%d User Type Invalid"},
+ "%s:%d Unwrapping Key Type Inconsistent",
+ "%s:%d User Already Logged In",
+ "%s:%d User Not Logged In",
+ "%s:%d User PIN Not Initialized",
+ "%s:%d User Type Invalid",
//60
- {"%s:%d Another User Already Logged In"},
- {"%s:%d Too Many User Types"},
- {"%s:%d Wrapped Key Invalid"},
- {"%s:%d Wrapped Key Length Out of Range"},
- {"%s:%d Wrapping Key Size out of Range"},
+ "%s:%d Another User Already Logged In",
+ "%s:%d Too Many User Types",
+ "%s:%d Wrapped Key Invalid",
+ "%s:%d Wrapped Key Length Out of Range",
+ "%s:%d Wrapping Key Size out of Range",
//65
- {"%s:%d Wrapping Key Type Inconsistent"},
- {"%s:%d Random Seed Not Supported"},
- {"%s:%d Random Number Invalid"},
- {"%s:%d Buffer Too Small"},
- {"%s:%d Saved State Invalid"},
+ "%s:%d Wrapping Key Type Inconsistent",
+ "%s:%d Random Seed Not Supported",
+ "%s:%d Random Number Invalid",
+ "%s:%d Buffer Too Small",
+ "%s:%d Saved State Invalid",
//70
- {"%s:%d Information Sensitive"},
- {"%s:%d State Unsaveable"},
- {"%s:%d API not initialized"},
- {"%s:%d API already Initialized"},
- {"%s:%d Mutex Bad"},
+ "%s:%d Information Sensitive",
+ "%s:%d State Unsaveable",
+ "%s:%d API not initialized",
+ "%s:%d API already Initialized",
+ "%s:%d Mutex Bad",
//75
- {"%s:%d Mutex Lock Invalid"},
- {"%s:%d Encode Integer Failed"},
- {"%s:%d Encode Octet String Failed"},
- {"%s:%d Encode Sequence Failed"},
- {"%s:%d Decode Integer Failed"},
+ "%s:%d Mutex Lock Invalid",
+ "%s:%d Encode Integer Failed",
+ "%s:%d Encode Octet String Failed",
+ "%s:%d Encode Sequence Failed",
+ "%s:%d Decode Integer Failed",
//80
- {"%s:%d Decode Octet String Failed"},
- {"%s:%d Decode Sequence Failed"},
- {"%s:%d Encode Private Key Failed"},
- {"%s:%d Decode Private Key Failed"},
- {"%s:%d Build Attribute Failed"},
+ "%s:%d Decode Octet String Failed",
+ "%s:%d Decode Sequence Failed",
+ "%s:%d Encode Private Key Failed",
+ "%s:%d Decode Private Key Failed",
+ "%s:%d Build Attribute Failed",
//85
- {"%s:%d Function Not Permitted"},
- {"%s:%d Key Not Exportable"},
- {"%s:%d Encode Private Key failed"},
- {"%s:%d Decode Private Key failed"},
- {"%s:%d Object Mgr Create Skeleton failed"},
+ "%s:%d Function Not Permitted",
+ "%s:%d Key Not Exportable",
+ "%s:%d Encode Private Key failed",
+ "%s:%d Decode Private Key failed",
+ "%s:%d Object Mgr Create Skeleton failed",
//90
- {"%s:%d Object Mgr Create Final failed"},
- {"%s:%d Key Generation failed"},
- {"%s:%d DES Wrap Get Data Failed"},
- {"%s:%d DES3 Wrap Get Data Failed"},
- {"%s:%d RSA Wrap Get Data Failed"},
+ "%s:%d Object Mgr Create Final failed",
+ "%s:%d Key Generation failed",
+ "%s:%d DES Wrap Get Data Failed",
+ "%s:%d DES3 Wrap Get Data Failed",
+ "%s:%d RSA Wrap Get Data Failed",
//95
- {"%s:%d DSA Wrap Get Data Failed"},
- {"%s:%d Generic Secret Wrap Get Data Failed"},
- {"%s:%d DES Wrap Format Failed"},
- {"%s:%d Encryption Mgr Init Failed"},
- {"%s:%d Encryption Mgr Encrypt Failed"},
+ "%s:%d DSA Wrap Get Data Failed",
+ "%s:%d Generic Secret Wrap Get Data Failed",
+ "%s:%d DES Wrap Format Failed",
+ "%s:%d Encryption Mgr Init Failed",
+ "%s:%d Encryption Mgr Encrypt Failed",
//100
- {"%s:%d Decryption Mgr Decrypt Failed"},
- {"%s:%d Flatten Object Failed"},
- {"%s:%d Key Mgr Get Priv Key Type Failed"},
- {"%s:%d Decrypt Private Key Info Failed"},
- {"%s:%d Save Token Failed"},
+ "%s:%d Decryption Mgr Decrypt Failed",
+ "%s:%d Flatten Object Failed",
+ "%s:%d Key Mgr Get Priv Key Type Failed",
+ "%s:%d Decrypt Private Key Info Failed",
+ "%s:%d Save Token Failed",
//105
- {"%s:%d Triple DES CBC Encrypt Failed"},
- {"%s:%d Triple DES CBC Decrypt Failed"},
- {"%s:%d Restore Private Token Failed"},
- {"%s:%d Restore Object Failed"},
- {"%s:%d Data Length Out of Range"},
+ "%s:%d Triple DES CBC Encrypt Failed",
+ "%s:%d Triple DES CBC Decrypt Failed",
+ "%s:%d Restore Private Token Failed",
+ "%s:%d Restore Object Failed",
+ "%s:%d Data Length Out of Range",
//110
- {"%s:%d Object Manager Find in Map Failed"},
- {"%s:%d Token Specific RNG Failed"},
- {"%s:%d Encrypted Data Length Out of Range"},
- {"%s:%d DES CBC Encrypt Failed"},
- {"%s:%d DES CBC Decrypt Failed"},
+ "%s:%d Object Manager Find in Map Failed",
+ "%s:%d Token Specific RNG Failed",
+ "%s:%d Encrypted Data Length Out of Range",
+ "%s:%d DES CBC Encrypt Failed",
+ "%s:%d DES CBC Decrypt Failed",
//115
- {"%s:%d DES ECB Encrypt Failed"},
- {"%s:%d DES ECB Decrypt Failed"},
- {"%s:%d Token Specific DES ECB Failed"},
- {"%s:%d Token Specific DES CBC Failed"},
- {"%s:%d Token Specific 3DES CBC Failed"},
+ "%s:%d DES ECB Encrypt Failed",
+ "%s:%d DES ECB Decrypt Failed",
+ "%s:%d Token Specific DES ECB Failed",
+ "%s:%d Token Specific DES CBC Failed",
+ "%s:%d Token Specific 3DES CBC Failed",
//120
- {"%s:%d Token Specific 3DES ECB Failed"},
- {"%s:%d DSA Verify Failed"},
- {"%s:%d DSA Sign Failed"},
- {"%s:%d Digest Init Failed"},
- {"%s:%d Digest Failed"},
+ "%s:%d Token Specific 3DES ECB Failed",
+ "%s:%d DSA Verify Failed",
+ "%s:%d DSA Sign Failed",
+ "%s:%d Digest Init Failed",
+ "%s:%d Digest Failed",
//125
- {"%s:%d Digest Update Failed"},
- {"%s:%d Digest Final Failed"},
- {"%s:%d Sign Init Failed"},
- {"%s:%d Sign Update Failed"},
- {"%s:%d Sign Final Failed"},
+ "%s:%d Digest Update Failed",
+ "%s:%d Digest Final Failed",
+ "%s:%d Sign Init Failed",
+ "%s:%d Sign Update Failed",
+ "%s:%d Sign Final Failed",
//130
- {"%s:%d Random Number Generate Failed"},
- {"%s:%d RSA Format Block Failed"},
- {"%s:%d RSA Encrypt Failed"},
- {"%s:%d RSA Decrypt Failed"},
- {"%s:%d Token Specific RSA Encrypt Failed"},
+ "%s:%d Random Number Generate Failed",
+ "%s:%d RSA Format Block Failed",
+ "%s:%d RSA Encrypt Failed",
+ "%s:%d RSA Decrypt Failed",
+ "%s:%d Token Specific RSA Encrypt Failed",
//135
- {"%s:%d Token Specific RSA Decrypt Failed"},
- {"%s:%d SSL SHA Failed"},
- {"%s:%d SSL3 MD5 Failed"},
- {"%s:%d SSL3 Process MAC Keys Failed"},
- {"%s:%d SSL3 Process Write Keys Failed"},
+ "%s:%d Token Specific RSA Decrypt Failed",
+ "%s:%d SSL SHA Failed",
+ "%s:%d SSL3 MD5 Failed",
+ "%s:%d SSL3 Process MAC Keys Failed",
+ "%s:%d SSL3 Process Write Keys Failed",
//140
- {"%s:%d Validate Attribute Failed"},
- {"%s:%d SSL3 Process Write Keys Failed"},
- {"%s:%d %s Function Not Supported"},
- {"%s:%d Token Already Initialized"},
- {"%s:%d Cannot Attach to Shared Memory"},
+ "%s:%d Validate Attribute Failed",
+ "%s:%d SSL3 Process Write Keys Failed",
+ "%s:%d %s Function Not Supported",
+ "%s:%d Token Already Initialized",
+ "%s:%d Cannot Attach to Shared Memory",
//145
- {"%s:%d Token Specific Init Failed"},
- {"%s:%d Mutex Lock Failed"},
- {"%s:%d Mutex Unlock Failed"},
- {"%s:%d Hash Computation Failed"},
- {"%s:%d Save Master Key Failed"},
+ "%s:%d Token Specific Init Failed",
+ "%s:%d Mutex Lock Failed",
+ "%s:%d Mutex Unlock Failed",
+ "%s:%d Hash Computation Failed",
+ "%s:%d Save Master Key Failed",
//150
- {"%s:%d Process Lock Failed"},
- {"%s:%d Process Unlock Failed"},
- {"%s:%d Session Mgr New Failed"},
- {"%s:%d Close all Sessions Failed"},
- {"%s:%d Session Mgr Get Op State Failed"},
+ "%s:%d Process Lock Failed",
+ "%s:%d Process Unlock Failed",
+ "%s:%d Session Mgr New Failed",
+ "%s:%d Close all Sessions Failed",
+ "%s:%d Session Mgr Get Op State Failed",
//155
- {"%s:%d Load Master Key Failed"},
- {"%s:%d Object Create Failed"},
- {"%s:%d Object Mgr Add to Map Failed"},
- {"%s:%d Object Copy Failed"},
- {"%s:%d Object Get Attribute Values Failed"},
+ "%s:%d Load Master Key Failed",
+ "%s:%d Object Create Failed",
+ "%s:%d Object Mgr Add to Map Failed",
+ "%s:%d Object Copy Failed",
+ "%s:%d Object Get Attribute Values Failed",
//160
- {"%s:%d Object Restore Data Failed"},
- {"%s:%d Object Set Attribute Values Failed"},
- {"%s:%d Object Mgr Search for Object Failed"},
- {"%s:%d Copy Template Failed"},
- {"%s:%d Add Attribute Failed"},
+ "%s:%d Object Restore Data Failed",
+ "%s:%d Object Set Attribute Values Failed",
+ "%s:%d Object Mgr Search for Object Failed",
+ "%s:%d Copy Template Failed",
+ "%s:%d Add Attribute Failed",
//165
- {"%s:%d Check Required Attributes Failed"},
- {"%s:%d Unflatten Template Failed"},
- {"%s:%d Verify Init Failed"},
- {"%s:%d Verify Failed"},
- {"%s:%d Verify Update Failed"},
+ "%s:%d Check Required Attributes Failed",
+ "%s:%d Unflatten Template Failed",
+ "%s:%d Verify Init Failed",
+ "%s:%d Verify Failed",
+ "%s:%d Verify Update Failed",
//170
- {"%s:%d Verify Final Failed"},
- {"%s:%d Sign Failed"},
- {"%s:%d Set Default Attributes Failed"},
- {"%s:%d Unwrap Key Failed"},
- {"%s:%d Session Mgr New Failed"},
+ "%s:%d Verify Final Failed",
+ "%s:%d Sign Failed",
+ "%s:%d Set Default Attributes Failed",
+ "%s:%d Unwrap Key Failed",
+ "%s:%d Session Mgr New Failed",
//175
- {"%s:%d Merge Attributes Failed"},
- {"%s:%d Encryption Mgr Encrypt Update Failed"},
- {"%s:%d Encryption Mgr Encrypt Final Failed"},
- {"%s:%d Update Attribute Failed"},
- {"%s:%d Decryption Mgr Init Failed"},
+ "%s:%d Merge Attributes Failed",
+ "%s:%d Encryption Mgr Encrypt Update Failed",
+ "%s:%d Encryption Mgr Encrypt Final Failed",
+ "%s:%d Update Attribute Failed",
+ "%s:%d Decryption Mgr Init Failed",
//180
- {"%s:%d Decryption Mgr Update Failed"},
- {"%s:%d Decryption Mgr Final Failed"},
- {"%s:%d Object Mgr Destroy Failed"},
- {"%s:%d Attribute Undefined"},
- {"%s:%d Object Mgr Get Size Failed"},
+ "%s:%d Decryption Mgr Update Failed",
+ "%s:%d Decryption Mgr Final Failed",
+ "%s:%d Object Mgr Destroy Failed",
+ "%s:%d Attribute Undefined",
+ "%s:%d Object Mgr Get Size Failed",
//185
- {"%s:%d Object Manager Find Init Failed"},
- {"%s:%d Sign Recover Failed"},
- {"%s:%d Verify Recover Failed"},
- {"%s:%d Wrap Key Failed"},
- {"%s:%d Unwrap Key Failed"},
+ "%s:%d Object Manager Find Init Failed",
+ "%s:%d Sign Recover Failed",
+ "%s:%d Verify Recover Failed",
+ "%s:%d Wrap Key Failed",
+ "%s:%d Unwrap Key Failed",
//190
- {"%s:%d Derive Key Failed"},
- {"%s:%d AES Wrap Get Data Failed"},
- {"%s:%d AES Wrap Format Failed"},
- {"%s:%d Domain Parameter Invalid"},
- {"%s:%d File \"%s\" could not be opened, errno=%d"}
+ "%s:%d Derive Key Failed",
+ "%s:%d AES Wrap Get Data Failed",
+ "%s:%d AES Wrap Format Failed",
+ "%s:%d Domain Parameter Invalid",
+ "%s:%d File \"%s\" could not be opened, errno=%d"
};
diff --git a/usr/lib/pkcs11/cca_stdll/h_extern.h
b/usr/lib/pkcs11/cca_stdll/h_extern.h
index 4aac772..df67c12 100644
--- a/usr/lib/pkcs11/cca_stdll/h_extern.h
+++ b/usr/lib/pkcs11/cca_stdll/h_extern.h
@@ -2166,7 +2166,7 @@ extern const token_spec_t token_specific;
#define LogInfo(fmt, ...) LogMessage(stdout, "LOG_INFO", STDLL_NAME,
fmt, ##__VA_ARGS__)
#define LogInfo1(data) LogMessage1(stdout, "LOG_INFO", STDLL_NAME,
data)
-#define st_err_log(num, ...) LogMessage(stderr, "ERROR", STDLL_NAME, "%s",
err_msg[num].msg)
+#define st_err_log(num, ...) LogMessage(stderr, "ERROR", STDLL_NAME, "%s",
err_msg[num])
void dump_shm(const char *);
#define DUMP_SHM(x) dump_shm(x)
diff --git a/usr/lib/pkcs11/common/h_extern.h b/usr/lib/pkcs11/common/h_extern.h
index 0a4fa21..3681bdb 100644
--- a/usr/lib/pkcs11/common/h_extern.h
+++ b/usr/lib/pkcs11/common/h_extern.h
@@ -2445,7 +2445,7 @@ extern const token_spec_t token_specific;
#define LogInfo(fmt, ...) LogMessage(stdout, "LOG_INFO", STDLL_NAME,
fmt, ##__VA_ARGS__)
#define LogInfo1(data) LogMessage1(stdout, "LOG_INFO", STDLL_NAME,
data)
-#define st_err_log(num, ...) LogMessage(stderr, "ERROR", STDLL_NAME, "%s",
err_msg[num].msg)
+#define st_err_log(num, ...) LogMessage(stderr, "ERROR", STDLL_NAME, "%s",
err_msg[num])
void dump_shm(const char *);
#define DUMP_SHM(x) dump_shm(x)
diff --git a/usr/lib/pkcs11/common/log.c b/usr/lib/pkcs11/common/log.c
index bce00b6..12c5e81 100644
--- a/usr/lib/pkcs11/common/log.c
+++ b/usr/lib/pkcs11/common/log.c
@@ -440,239 +440,239 @@ stlogit(char *fmt, ...)
/* moved in from msg.h */
-struct messages err_msg[]={
- {"Malloc Failed"},
- {"Not Enough Memory in Context"},
- {"Slot Invalid"},
- {"General Error"},
- {"%s Function Failed"},
+const char *const err_msg[]={
+ "Malloc Failed",
+ "Not Enough Memory in Context",
+ "Slot Invalid",
+ "General Error",
+ "%s Function Failed",
//#5
- {"%s Bad Arguments"},
- {"No Event"},
- {"Attribute Read Only"},
- {"Attribute Type Invalid"},
- {"Attribute Value Invalid"},
+ "%s Bad Arguments",
+ "No Event",
+ "Attribute Read Only",
+ "Attribute Type Invalid",
+ "Attribute Value Invalid",
//#10
- {"Data Invalid"},
- {"Data Length out of Range"},
- {"Device Error"},
- {"Device Removed"},
- {"Encrypted Data Invalid"},
+ "Data Invalid",
+ "Data Length out of Range",
+ "Device Error",
+ "Device Removed",
+ "Encrypted Data Invalid",
//15
- {"Encrypted Data Length out of Range"},
- {"Function Cancelled"},
- {"Function Not Parallel"},
- {"Key Handle Invalid"},
- {"Key Size out of Range"},
+ "Encrypted Data Length out of Range",
+ "Function Cancelled",
+ "Function Not Parallel",
+ "Key Handle Invalid",
+ "Key Size out of Range",
//20
- {"Key Type Inconsistent"},
- {"Key Not Needed"},
- {"Key Changed"},
- {"Key Needed"},
- {"Key Indigestible"},
+ "Key Type Inconsistent",
+ "Key Not Needed",
+ "Key Changed",
+ "Key Needed",
+ "Key Indigestible",
//25
- {"Key Function Not Permitted"},
- {"Key Not Wrappable"},
- {"Key Unextractable"},
- {"Mechanism Invalid"},
- {"Mechanism Param Invalid"},
+ "Key Function Not Permitted",
+ "Key Not Wrappable",
+ "Key Unextractable",
+ "Mechanism Invalid",
+ "Mechanism Param Invalid",
//30
- {"Object Handle Invalid"},
- {"Operation Active"},
- {"Operation Not Initialized"},
- {"Pin Incorrect"},
- {"Pin Invalid"},
+ "Object Handle Invalid",
+ "Operation Active",
+ "Operation Not Initialized",
+ "Pin Incorrect",
+ "Pin Invalid",
//35
- {"Pin Length out of Range"},
- {"Pin Expired"},
- {"Pin Locked"},
- {"Session Closed"},
- {"Session Count"},
+ "Pin Length out of Range",
+ "Pin Expired",
+ "Pin Locked",
+ "Session Closed",
+ "Session Count",
//40
- {"Session Handle Invalid"},
- {"Parallel Session Not Supported"},
- {"Session Read Only"},
- {"Session Exists"},
- {"Session Read only Exists"},
+ "Session Handle Invalid",
+ "Parallel Session Not Supported",
+ "Session Read Only",
+ "Session Exists",
+ "Session Read only Exists",
//45
- {"Session Read Write Exists"},
- {"Signature Length out of Range"},
- {"Signature Invalid"},
- {"Template Incomplete"},
- {"Template Inconsistent"},
+ "Session Read Write Exists",
+ "Signature Length out of Range",
+ "Signature Invalid",
+ "Template Incomplete",
+ "Template Inconsistent",
//50
- {"Token Not Present"},
- {"Token Not Recognized"},
- {"Token Write Protected"},
- {"Unwrapping Key Handle Invalid"},
- {"Unwrapping Key Size Range Invalid"},
+ "Token Not Present",
+ "Token Not Recognized",
+ "Token Write Protected",
+ "Unwrapping Key Handle Invalid",
+ "Unwrapping Key Size Range Invalid",
//55
- {"Unwrapping Key Type Inconsistent"},
- {"User Already Logged In"},
- {"User Not Logged In"},
- {"User PIN Not Initialized"},
- {"User Type Invalid"},
+ "Unwrapping Key Type Inconsistent",
+ "User Already Logged In",
+ "User Not Logged In",
+ "User PIN Not Initialized",
+ "User Type Invalid",
//60
- {"Another User Already Logged In"},
- {"Too Many User Types"},
- {"Wrapped Key Invalid"},
- {"Wrapped Key Length Out of Range"},
- {"Wrapping Key Size out of Range"},
+ "Another User Already Logged In",
+ "Too Many User Types",
+ "Wrapped Key Invalid",
+ "Wrapped Key Length Out of Range",
+ "Wrapping Key Size out of Range",
//65
- {"Wrapping Key Type Inconsistent"},
- {"Random Seed Not Supported"},
- {"Random Number Invalid"},
- {"Buffer Too Small"},
- {"Saved State Invalid"},
+ "Wrapping Key Type Inconsistent",
+ "Random Seed Not Supported",
+ "Random Number Invalid",
+ "Buffer Too Small",
+ "Saved State Invalid",
//70
- {"Information Sensitive"},
- {"State Unsaveable"},
- {"API not initialized"},
- {"API already Initialized"},
- {"Mutex Bad"},
+ "Information Sensitive",
+ "State Unsaveable",
+ "API not initialized",
+ "API already Initialized",
+ "Mutex Bad",
//75
- {"Mutex Lock Invalid"},
- {"Encode Integer Failed"},
- {"Encode Octet String Failed"},
- {"Encode Sequence Failed"},
- {"Decode Integer Failed"},
+ "Mutex Lock Invalid",
+ "Encode Integer Failed",
+ "Encode Octet String Failed",
+ "Encode Sequence Failed",
+ "Decode Integer Failed",
//80
- {"Decode Octet String Failed"},
- {"Decode Sequence Failed"},
- {"Encode Private Key Failed"},
- {"Decode Private Key Failed"},
- {"Build Attribute Failed"},
+ "Decode Octet String Failed",
+ "Decode Sequence Failed",
+ "Encode Private Key Failed",
+ "Decode Private Key Failed",
+ "Build Attribute Failed",
//85
- {"Function Not Permitted"},
- {"Key Not Exportable"},
- {"Encode Private Key failed"},
- {"Decode Private Key failed"},
- {"Object Mgr Create Skeleton failed"},
+ "Function Not Permitted",
+ "Key Not Exportable",
+ "Encode Private Key failed",
+ "Decode Private Key failed",
+ "Object Mgr Create Skeleton failed",
//90
- {"Object Mgr Create Final failed"},
- {"Key Generation failed"},
- {"DES Wrap Get Data Failed"},
- {"DES3 Wrap Get Data Failed"},
- {"RSA Wrap Get Data Failed"},
+ "Object Mgr Create Final failed",
+ "Key Generation failed",
+ "DES Wrap Get Data Failed",
+ "DES3 Wrap Get Data Failed",
+ "RSA Wrap Get Data Failed",
//95
- {"DSA Wrap Get Data Failed"},
- {"Generic Secret Wrap Get Data Failed"},
- {"DES Wrap Format Failed"},
- {"Encryption Mgr Init Failed"},
- {"Encryption Mgr Encrypt Failed"},
+ "DSA Wrap Get Data Failed",
+ "Generic Secret Wrap Get Data Failed",
+ "DES Wrap Format Failed",
+ "Encryption Mgr Init Failed",
+ "Encryption Mgr Encrypt Failed",
//100
- {"Decryption Mgr Decrypt Failed"},
- {"Flatten Object Failed"},
- {"Key Mgr Get Priv Key Type Failed"},
- {"Decrypt Private Key Info Failed"},
- {"Save Token Failed"},
+ "Decryption Mgr Decrypt Failed",
+ "Flatten Object Failed",
+ "Key Mgr Get Priv Key Type Failed",
+ "Decrypt Private Key Info Failed",
+ "Save Token Failed",
//105
- {"Triple DES CBC Encrypt Failed"},
- {"Triple DES CBC Decrypt Failed"},
- {"Restore Private Token Failed"},
- {"Restore Object Failed"},
- {"Data Length Out of Range"},
+ "Triple DES CBC Encrypt Failed",
+ "Triple DES CBC Decrypt Failed",
+ "Restore Private Token Failed",
+ "Restore Object Failed",
+ "Data Length Out of Range",
//110
- {"Object Manager Find in Map Failed"},
- {"Token Specific RNG Failed"},
- {"Encrypted Data Length Out of Range"},
- {"DES CBC Encrypt Failed"},
- {"DES CBC Decrypt Failed"},
+ "Object Manager Find in Map Failed",
+ "Token Specific RNG Failed",
+ "Encrypted Data Length Out of Range",
+ "DES CBC Encrypt Failed",
+ "DES CBC Decrypt Failed",
//115
- {"DES ECB Encrypt Failed"},
- {"DES ECB Decrypt Failed"},
- {"Token Specific DES ECB Failed"},
- {"Token Specific DES CBC Failed"},
- {"Token Specific 3DES CBC Failed"},
+ "DES ECB Encrypt Failed",
+ "DES ECB Decrypt Failed",
+ "Token Specific DES ECB Failed",
+ "Token Specific DES CBC Failed",
+ "Token Specific 3DES CBC Failed",
//120
- {"Token Specific 3DES ECB Failed"},
- {"DSA Verify Failed"},
- {"DSA Sign Failed"},
- {"Digest Init Failed"},
- {"Digest Failed"},
+ "Token Specific 3DES ECB Failed",
+ "DSA Verify Failed",
+ "DSA Sign Failed",
+ "Digest Init Failed",
+ "Digest Failed",
//125
- {"Digest Update Failed"},
- {"Digest Final Failed"},
- {"Sign Init Failed"},
- {"Sign Update Failed"},
- {"Sign Final Failed"},
+ "Digest Update Failed",
+ "Digest Final Failed",
+ "Sign Init Failed",
+ "Sign Update Failed",
+ "Sign Final Failed",
//130
- {"Random Number Generate Failed"},
- {"RSA Format Block Failed"},
- {"RSA Encrypt Failed"},
- {"RSA Decrypt Failed"},
- {"Token Specific RSA Encrypt Failed"},
+ "Random Number Generate Failed",
+ "RSA Format Block Failed",
+ "RSA Encrypt Failed",
+ "RSA Decrypt Failed",
+ "Token Specific RSA Encrypt Failed",
//135
- {"Token Specific RSA Decrypt Failed"},
- {"SSL SHA Failed"},
- {"SSL3 MD5 Failed"},
- {"SSL3 Process MAC Keys Failed"},
- {"SSL3 Process Write Keys Failed"},
+ "Token Specific RSA Decrypt Failed",
+ "SSL SHA Failed",
+ "SSL3 MD5 Failed",
+ "SSL3 Process MAC Keys Failed",
+ "SSL3 Process Write Keys Failed",
//140
- {"Validate Attribute Failed"},
- {"SSL3 Process Write Keys Failed"},
- {"%s Function Not Supported"},
- {"Token Already Initialized"},
- {"Cannot Attach to Shared Memory"},
+ "Validate Attribute Failed",
+ "SSL3 Process Write Keys Failed",
+ "%s Function Not Supported",
+ "Token Already Initialized",
+ "Cannot Attach to Shared Memory",
//145
- {"Token Specific Init Failed"},
- {"Mutex Lock Failed"},
- {"Mutex Unlock Failed"},
- {"Hash Computation Failed"},
- {"Save Master Key Failed"},
+ "Token Specific Init Failed",
+ "Mutex Lock Failed",
+ "Mutex Unlock Failed",
+ "Hash Computation Failed",
+ "Save Master Key Failed",
//150
- {"Process Lock Failed"},
- {"Process Unlock Failed"},
- {"Session Mgr New Failed"},
- {"Close all Sessions Failed"},
- {"Session Mgr Get Op State Failed"},
+ "Process Lock Failed",
+ "Process Unlock Failed",
+ "Session Mgr New Failed",
+ "Close all Sessions Failed",
+ "Session Mgr Get Op State Failed",
//155
- {"Load Master Key Failed"},
- {"Object Create Failed"},
- {"Object Mgr Add to Map Failed"},
- {"Object Copy Failed"},
- {"Object Get Attribute Values Failed"},
+ "Load Master Key Failed",
+ "Object Create Failed",
+ "Object Mgr Add to Map Failed",
+ "Object Copy Failed",
+ "Object Get Attribute Values Failed",
//160
- {"Object Restore Data Failed"},
- {"Object Set Attribute Values Failed"},
- {"Object Mgr Search for Object Failed"},
- {"Copy Template Failed"},
- {"Add Attribute Failed"},
+ "Object Restore Data Failed",
+ "Object Set Attribute Values Failed",
+ "Object Mgr Search for Object Failed",
+ "Copy Template Failed",
+ "Add Attribute Failed",
//165
- {"Check Required Attributes Failed"},
- {"Unflatten Template Failed"},
- {"Verify Init Failed"},
- {"Verify Failed"},
- {"Verify Update Failed"},
+ "Check Required Attributes Failed",
+ "Unflatten Template Failed",
+ "Verify Init Failed",
+ "Verify Failed",
+ "Verify Update Failed",
//170
- {"Verify Final Failed"},
- {"Sign Failed"},
- {"Set Default Attributes Failed"},
- {"Unwrap Key Failed"},
- {"Session Mgr New Failed"},
+ "Verify Final Failed",
+ "Sign Failed",
+ "Set Default Attributes Failed",
+ "Unwrap Key Failed",
+ "Session Mgr New Failed",
//175
- {"Merge Attributes Failed"},
- {"Encryption Mgr Encrypt Update Failed"},
- {"Encryption Mgr Encrypt Final Failed"},
- {"Update Attribute Failed"},
- {"Decryption Mgr Init Failed"},
+ "Merge Attributes Failed",
+ "Encryption Mgr Encrypt Update Failed",
+ "Encryption Mgr Encrypt Final Failed",
+ "Update Attribute Failed",
+ "Decryption Mgr Init Failed",
//180
- {"Decryption Mgr Update Failed"},
- {"Decryption Mgr Final Failed"},
- {"Object Mgr Destroy Failed"},
- {"Attribute Undefined"},
- {"Object Mgr Get Size Failed"},
+ "Decryption Mgr Update Failed",
+ "Decryption Mgr Final Failed",
+ "Object Mgr Destroy Failed",
+ "Attribute Undefined",
+ "Object Mgr Get Size Failed",
//185
- {"Object Manager Find Init Failed"},
- {"Sign Recover Failed"},
- {"Verify Recover Failed"},
- {"Wrap Key Failed"},
- {"Unwrap Key Failed"},
+ "Object Manager Find Init Failed",
+ "Sign Recover Failed",
+ "Verify Recover Failed",
+ "Wrap Key Failed",
+ "Unwrap Key Failed",
//190
- {"Derive Key Failed"},
- {"AES Wrap Get Data Failed"},
- {"AES Wrap Format Failed"},
- {"Domain Parameter Invalid"},
- {"File \"%s\" could not be opened, errno=%d"}
+ "Derive Key Failed",
+ "AES Wrap Get Data Failed",
+ "AES Wrap Format Failed",
+ "Domain Parameter Invalid",
+ "File \"%s\" could not be opened, errno=%d"
};
diff --git a/usr/lib/pkcs11/common/msg.h b/usr/lib/pkcs11/common/msg.h
index fa83a90..718b5e4 100644
--- a/usr/lib/pkcs11/common/msg.h
+++ b/usr/lib/pkcs11/common/msg.h
@@ -299,10 +299,6 @@
#ifndef __MSG_H__
#define __MSG_H__
-struct messages {
- char * msg;
-};
-
-extern struct messages err_msg[];
+extern const char *const err_msg[];
#endif
--
1.7.5.rc1
------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been
demonstrated beyond question. Learn why your peers are replacing JEE
containers with lightweight application servers - and what you can gain
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
Opencryptoki-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech