202 lines
5.9 KiB
Diff
202 lines
5.9 KiB
Diff
diff -Naur softhsm-2.0.0-orig/src/lib/P11Attributes.cpp softhsm-2.0.0/src/lib/P11Attributes.cpp
|
|
--- softhsm-2.0.0-orig/src/lib/P11Attributes.cpp 2015-06-01 07:28:14.000000000 -0400
|
|
+++ softhsm-2.0.0/src/lib/P11Attributes.cpp 2016-02-25 11:36:25.005775010 -0500
|
|
@@ -482,15 +482,10 @@
|
|
}
|
|
|
|
// Update the value if allowed
|
|
-CK_RV P11AttrClass::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int op)
|
|
+CK_RV P11AttrClass::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int /*op*/)
|
|
{
|
|
// Attribute specific checks
|
|
|
|
- if (op == OBJECT_OP_SET)
|
|
- {
|
|
- return CKR_ATTRIBUTE_READ_ONLY;
|
|
- }
|
|
-
|
|
if (ulValueLen !=sizeof(CK_ULONG))
|
|
{
|
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|
|
@@ -516,15 +511,10 @@
|
|
}
|
|
|
|
// Update the value if allowed
|
|
-CK_RV P11AttrKeyType::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int op)
|
|
+CK_RV P11AttrKeyType::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int /*op*/)
|
|
{
|
|
// Attribute specific checks
|
|
|
|
- if (op == OBJECT_OP_SET)
|
|
- {
|
|
- return CKR_ATTRIBUTE_READ_ONLY;
|
|
- }
|
|
-
|
|
if (ulValueLen !=sizeof(CK_ULONG))
|
|
{
|
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|
|
@@ -552,15 +542,10 @@
|
|
}
|
|
|
|
// Update the value if allowed
|
|
-CK_RV P11AttrCertificateType::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int op)
|
|
+CK_RV P11AttrCertificateType::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int /*op*/)
|
|
{
|
|
// Attribute specific checks
|
|
|
|
- if (op == OBJECT_OP_SET)
|
|
- {
|
|
- return CKR_ATTRIBUTE_READ_ONLY;
|
|
- }
|
|
-
|
|
if (ulValueLen !=sizeof(CK_ULONG))
|
|
{
|
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|
|
@@ -586,22 +571,13 @@
|
|
}
|
|
|
|
// Update the value if allowed
|
|
-CK_RV P11AttrToken::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int op)
|
|
+CK_RV P11AttrToken::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int /*op*/)
|
|
{
|
|
OSAttribute attrTrue(true);
|
|
OSAttribute attrFalse(false);
|
|
|
|
// Attribute specific checks
|
|
|
|
- if (op != OBJECT_OP_GENERATE &&
|
|
- op != OBJECT_OP_DERIVE &&
|
|
- op != OBJECT_OP_CREATE &&
|
|
- op != OBJECT_OP_COPY &&
|
|
- op != OBJECT_OP_UNWRAP)
|
|
- {
|
|
- return CKR_ATTRIBUTE_READ_ONLY;
|
|
- }
|
|
-
|
|
if (ulValueLen !=sizeof(CK_BBOOL))
|
|
{
|
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|
|
@@ -633,22 +609,13 @@
|
|
}
|
|
|
|
// Update the value if allowed
|
|
-CK_RV P11AttrPrivate::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int op)
|
|
+CK_RV P11AttrPrivate::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int /*op*/)
|
|
{
|
|
OSAttribute attrTrue(true);
|
|
OSAttribute attrFalse(false);
|
|
|
|
// Attribute specific checks
|
|
|
|
- if (op != OBJECT_OP_GENERATE &&
|
|
- op != OBJECT_OP_DERIVE &&
|
|
- op != OBJECT_OP_CREATE &&
|
|
- op != OBJECT_OP_COPY &&
|
|
- op != OBJECT_OP_UNWRAP)
|
|
- {
|
|
- return CKR_ATTRIBUTE_READ_ONLY;
|
|
- }
|
|
-
|
|
if (ulValueLen !=sizeof(CK_BBOOL))
|
|
{
|
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|
|
@@ -680,22 +647,13 @@
|
|
}
|
|
|
|
// Update the value if allowed
|
|
-CK_RV P11AttrModifiable::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int op)
|
|
+CK_RV P11AttrModifiable::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int /*op*/)
|
|
{
|
|
OSAttribute attrTrue(true);
|
|
OSAttribute attrFalse(false);
|
|
|
|
// Attribute specific checks
|
|
|
|
- if (op != OBJECT_OP_GENERATE &&
|
|
- op != OBJECT_OP_DERIVE &&
|
|
- op != OBJECT_OP_CREATE &&
|
|
- op != OBJECT_OP_COPY &&
|
|
- op != OBJECT_OP_UNWRAP)
|
|
- {
|
|
- return CKR_ATTRIBUTE_READ_ONLY;
|
|
- }
|
|
-
|
|
if (ulValueLen !=sizeof(CK_BBOOL))
|
|
{
|
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|
|
@@ -738,22 +696,13 @@
|
|
}
|
|
|
|
// Update the value if allowed
|
|
-CK_RV P11AttrCopyable::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int op)
|
|
+CK_RV P11AttrCopyable::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int /*op*/)
|
|
{
|
|
OSAttribute attrTrue(true);
|
|
OSAttribute attrFalse(false);
|
|
|
|
// Attribute specific checks
|
|
|
|
- if (op != OBJECT_OP_GENERATE &&
|
|
- op != OBJECT_OP_DERIVE &&
|
|
- op != OBJECT_OP_CREATE &&
|
|
- op != OBJECT_OP_COPY &&
|
|
- op != OBJECT_OP_UNWRAP)
|
|
- {
|
|
- return CKR_ATTRIBUTE_READ_ONLY;
|
|
- }
|
|
-
|
|
if (ulValueLen !=sizeof(CK_BBOOL))
|
|
{
|
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|
|
@@ -955,15 +904,10 @@
|
|
}
|
|
|
|
// Update the value if allowed
|
|
-CK_RV P11AttrCertificateCategory::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int op)
|
|
+CK_RV P11AttrCertificateCategory::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int /*op*/)
|
|
{
|
|
// Attribute specific checks
|
|
|
|
- if (op != OBJECT_OP_SET)
|
|
- {
|
|
- return CKR_ATTRIBUTE_READ_ONLY;
|
|
- }
|
|
-
|
|
if (ulValueLen !=sizeof(CK_ULONG))
|
|
{
|
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|
|
@@ -1085,15 +1029,10 @@
|
|
}
|
|
|
|
// Update the value if allowed
|
|
-CK_RV P11AttrJavaMidpSecurityDomain::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int op)
|
|
+CK_RV P11AttrJavaMidpSecurityDomain::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int /*op*/)
|
|
{
|
|
// Attribute specific checks
|
|
|
|
- if (op != OBJECT_OP_SET)
|
|
- {
|
|
- return CKR_ATTRIBUTE_READ_ONLY;
|
|
- }
|
|
-
|
|
if (ulValueLen !=sizeof(CK_ULONG))
|
|
{
|
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|
|
@@ -1117,15 +1056,10 @@
|
|
}
|
|
|
|
// Update the value if allowed
|
|
-CK_RV P11AttrNameHashAlgorithm::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int op)
|
|
+CK_RV P11AttrNameHashAlgorithm::updateAttr(Token* /*token*/, bool /*isPrivate*/, CK_VOID_PTR pValue, CK_ULONG ulValueLen, int /*op*/)
|
|
{
|
|
// Attribute specific checks
|
|
|
|
- if (op != OBJECT_OP_SET)
|
|
- {
|
|
- return CKR_ATTRIBUTE_READ_ONLY;
|
|
- }
|
|
-
|
|
if (ulValueLen !=sizeof(CK_ULONG))
|
|
{
|
|
return CKR_ATTRIBUTE_VALUE_INVALID;
|