summaryrefslogtreecommitdiffstats
path: root/SoftHSMv2/src/lib/object_store
diff options
context:
space:
mode:
authorPramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>2019-01-02 09:59:48 -0800
committerPramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>2019-03-29 09:59:04 -0700
commit7626b75b3c71173ba62c2f92d22bab8f4291e44a (patch)
tree7308a2628a014fef0f245ef4f00408cf92d15e60 /SoftHSMv2/src/lib/object_store
parentf2ff7a136a152b36b3aa4d0d574796e6edbef24a (diff)
Update SoftHSM v2.0 to the latest version
Change-Id: Ib3ec2c297f897c82776a66fe2ad55b18984c0337 Issue-ID: AAF-687 Signed-off-by: Pramod Raghavendra Jayathirth <pramod.raghavendra.jayathirth@intel.com>
Diffstat (limited to 'SoftHSMv2/src/lib/object_store')
-rw-r--r--SoftHSMv2/src/lib/object_store/DBObject.cpp2
-rw-r--r--SoftHSMv2/src/lib/object_store/Makefile.am3
-rw-r--r--SoftHSMv2/src/lib/object_store/test/DBObjectTests.cpp8
-rw-r--r--SoftHSMv2/src/lib/object_store/test/DBTests.cpp2
-rw-r--r--SoftHSMv2/src/lib/object_store/test/Makefile.am5
-rw-r--r--SoftHSMv2/src/lib/object_store/test/ObjectFileTests.cpp8
-rw-r--r--SoftHSMv2/src/lib/object_store/test/SessionObjectTests.cpp8
7 files changed, 19 insertions, 17 deletions
diff --git a/SoftHSMv2/src/lib/object_store/DBObject.cpp b/SoftHSMv2/src/lib/object_store/DBObject.cpp
index a55a32a..bf40bc8 100644
--- a/SoftHSMv2/src/lib/object_store/DBObject.cpp
+++ b/SoftHSMv2/src/lib/object_store/DBObject.cpp
@@ -453,7 +453,7 @@ static AttributeKind attributeKind(CK_ATTRIBUTE_TYPE type)
case CKA_SUBPRIME: return akBinary;
case CKA_BASE: return akBinary;
case CKA_PRIME_BITS: return akInteger;
- case CKA_SUBPRIME_BITS: return akInteger;
+ case CKA_SUB_PRIME_BITS: return akInteger;
case CKA_VALUE_BITS: return akInteger;
case CKA_VALUE_LEN: return akInteger;
case CKA_EXTRACTABLE: return akBoolean;
diff --git a/SoftHSMv2/src/lib/object_store/Makefile.am b/SoftHSMv2/src/lib/object_store/Makefile.am
index d3e89d3..6af0d2c 100644
--- a/SoftHSMv2/src/lib/object_store/Makefile.am
+++ b/SoftHSMv2/src/lib/object_store/Makefile.am
@@ -31,4 +31,5 @@ libsofthsm_objectstore_la_LDFLAGS = @SQLITE3_LIBS@
SUBDIRS = test
-EXTRA_DIST = $(srcdir)/*.h
+EXTRA_DIST = $(srcdir)/CMakeLists.txt \
+ $(srcdir)/*.h
diff --git a/SoftHSMv2/src/lib/object_store/test/DBObjectTests.cpp b/SoftHSMv2/src/lib/object_store/test/DBObjectTests.cpp
index d856b06..22d252c 100644
--- a/SoftHSMv2/src/lib/object_store/test/DBObjectTests.cpp
+++ b/SoftHSMv2/src/lib/object_store/test/DBObjectTests.cpp
@@ -202,7 +202,7 @@ void test_a_dbobject_with_an_object::should_store_unsigned_long_attributes()
CPPUNIT_ASSERT(testObject.setAttribute(CKA_MODULUS_BITS, attr1));
CPPUNIT_ASSERT(testObject.setAttribute(CKA_PRIME_BITS, attr2));
CPPUNIT_ASSERT(testObject.setAttribute(CKA_AUTH_PIN_FLAGS, attr3));
- CPPUNIT_ASSERT(testObject.setAttribute(CKA_SUBPRIME_BITS, attr4));
+ CPPUNIT_ASSERT(testObject.setAttribute(CKA_SUB_PRIME_BITS, attr4));
CPPUNIT_ASSERT(testObject.setAttribute(CKA_KEY_TYPE, attr5));
}
@@ -215,20 +215,20 @@ void test_a_dbobject_with_an_object::should_store_unsigned_long_attributes()
CPPUNIT_ASSERT(testObject.attributeExists(CKA_MODULUS_BITS));
CPPUNIT_ASSERT(testObject.attributeExists(CKA_PRIME_BITS));
CPPUNIT_ASSERT(testObject.attributeExists(CKA_AUTH_PIN_FLAGS));
- CPPUNIT_ASSERT(testObject.attributeExists(CKA_SUBPRIME_BITS));
+ CPPUNIT_ASSERT(testObject.attributeExists(CKA_SUB_PRIME_BITS));
CPPUNIT_ASSERT(testObject.attributeExists(CKA_KEY_TYPE));
CPPUNIT_ASSERT(!testObject.attributeExists(CKA_ID));
CPPUNIT_ASSERT(testObject.getAttribute(CKA_MODULUS_BITS).isUnsignedLongAttribute());
CPPUNIT_ASSERT(testObject.getAttribute(CKA_PRIME_BITS).isUnsignedLongAttribute());
CPPUNIT_ASSERT(testObject.getAttribute(CKA_AUTH_PIN_FLAGS).isUnsignedLongAttribute());
- CPPUNIT_ASSERT(testObject.getAttribute(CKA_SUBPRIME_BITS).isUnsignedLongAttribute());
+ CPPUNIT_ASSERT(testObject.getAttribute(CKA_SUB_PRIME_BITS).isUnsignedLongAttribute());
CPPUNIT_ASSERT(testObject.getAttribute(CKA_KEY_TYPE).isUnsignedLongAttribute());
CPPUNIT_ASSERT_EQUAL(testObject.getAttribute(CKA_MODULUS_BITS).getUnsignedLongValue(), (unsigned long)0x12345678);
CPPUNIT_ASSERT_EQUAL(testObject.getAttribute(CKA_PRIME_BITS).getUnsignedLongValue(), (unsigned long)0x87654321);
CPPUNIT_ASSERT_EQUAL(testObject.getAttribute(CKA_AUTH_PIN_FLAGS).getUnsignedLongValue(), (unsigned long)0x01010101);
- CPPUNIT_ASSERT_EQUAL(testObject.getAttribute(CKA_SUBPRIME_BITS).getUnsignedLongValue(), (unsigned long)0x10101010);
+ CPPUNIT_ASSERT_EQUAL(testObject.getAttribute(CKA_SUB_PRIME_BITS).getUnsignedLongValue(), (unsigned long)0x10101010);
CPPUNIT_ASSERT_EQUAL(testObject.getAttribute(CKA_KEY_TYPE).getUnsignedLongValue(), (unsigned long)0xABCDEF);
unsigned long value6 = 0x90909090;
diff --git a/SoftHSMv2/src/lib/object_store/test/DBTests.cpp b/SoftHSMv2/src/lib/object_store/test/DBTests.cpp
index d787a83..0e68358 100644
--- a/SoftHSMv2/src/lib/object_store/test/DBTests.cpp
+++ b/SoftHSMv2/src/lib/object_store/test/DBTests.cpp
@@ -348,7 +348,7 @@ void test_a_db_with_a_connection_with_tables::can_update_integer_attribute_bound
// insert integer attribute
statement = connection->prepare(
- "insert into attribute_integer (value,type,object_id) values (%lld,%d,%lld)",
+ "insert into attribute_integer (value,type,object_id) values (%d,%d,%lld)",
1111,
1235,
object_id);
diff --git a/SoftHSMv2/src/lib/object_store/test/Makefile.am b/SoftHSMv2/src/lib/object_store/test/Makefile.am
index 71de7dd..0ba05c1 100644
--- a/SoftHSMv2/src/lib/object_store/test/Makefile.am
+++ b/SoftHSMv2/src/lib/object_store/test/Makefile.am
@@ -30,10 +30,11 @@ objstoretest_SOURCES += DBTests.cpp \
DBObjectStoreTests.cpp
endif
-objstoretest_LDADD = ../../libsofthsm_convarch.la
+objstoretest_LDADD = ../../libsofthsm_convarch.la
objstoretest_LDFLAGS = @CRYPTO_LIBS@ @CPPUNIT_LIBS@ -no-install -pthread
TESTS = objstoretest
-EXTRA_DIST = $(srcdir)/*.h
+EXTRA_DIST = $(srcdir)/CMakeLists.txt \
+ $(srcdir)/*.h
diff --git a/SoftHSMv2/src/lib/object_store/test/ObjectFileTests.cpp b/SoftHSMv2/src/lib/object_store/test/ObjectFileTests.cpp
index 9f0f5bd..f3c3ae5 100644
--- a/SoftHSMv2/src/lib/object_store/test/ObjectFileTests.cpp
+++ b/SoftHSMv2/src/lib/object_store/test/ObjectFileTests.cpp
@@ -158,7 +158,7 @@ void ObjectFileTests::testULongAttr()
CPPUNIT_ASSERT(testObject.setAttribute(CKA_MODULUS_BITS, attr1));
CPPUNIT_ASSERT(testObject.setAttribute(CKA_PRIME_BITS, attr2));
CPPUNIT_ASSERT(testObject.setAttribute(CKA_AUTH_PIN_FLAGS, attr3));
- CPPUNIT_ASSERT(testObject.setAttribute(CKA_SUBPRIME_BITS, attr4));
+ CPPUNIT_ASSERT(testObject.setAttribute(CKA_SUB_PRIME_BITS, attr4));
CPPUNIT_ASSERT(testObject.setAttribute(CKA_KEY_TYPE, attr5));
}
@@ -175,20 +175,20 @@ void ObjectFileTests::testULongAttr()
CPPUNIT_ASSERT(testObject.attributeExists(CKA_MODULUS_BITS));
CPPUNIT_ASSERT(testObject.attributeExists(CKA_PRIME_BITS));
CPPUNIT_ASSERT(testObject.attributeExists(CKA_AUTH_PIN_FLAGS));
- CPPUNIT_ASSERT(testObject.attributeExists(CKA_SUBPRIME_BITS));
+ CPPUNIT_ASSERT(testObject.attributeExists(CKA_SUB_PRIME_BITS));
CPPUNIT_ASSERT(testObject.attributeExists(CKA_KEY_TYPE));
CPPUNIT_ASSERT(!testObject.attributeExists(CKA_ID));
CPPUNIT_ASSERT(testObject.getAttribute(CKA_MODULUS_BITS).isUnsignedLongAttribute());
CPPUNIT_ASSERT(testObject.getAttribute(CKA_PRIME_BITS).isUnsignedLongAttribute());
CPPUNIT_ASSERT(testObject.getAttribute(CKA_AUTH_PIN_FLAGS).isUnsignedLongAttribute());
- CPPUNIT_ASSERT(testObject.getAttribute(CKA_SUBPRIME_BITS).isUnsignedLongAttribute());
+ CPPUNIT_ASSERT(testObject.getAttribute(CKA_SUB_PRIME_BITS).isUnsignedLongAttribute());
CPPUNIT_ASSERT(testObject.getAttribute(CKA_KEY_TYPE).isUnsignedLongAttribute());
CPPUNIT_ASSERT(testObject.getAttribute(CKA_MODULUS_BITS).getUnsignedLongValue() == 0x12345678);
CPPUNIT_ASSERT(testObject.getAttribute(CKA_PRIME_BITS).getUnsignedLongValue() == 0x87654321);
CPPUNIT_ASSERT(testObject.getAttribute(CKA_AUTH_PIN_FLAGS).getUnsignedLongValue() == 0x01010101);
- CPPUNIT_ASSERT(testObject.getAttribute(CKA_SUBPRIME_BITS).getUnsignedLongValue() == 0x10101010);
+ CPPUNIT_ASSERT(testObject.getAttribute(CKA_SUB_PRIME_BITS).getUnsignedLongValue() == 0x10101010);
CPPUNIT_ASSERT(testObject.getAttribute(CKA_KEY_TYPE).getUnsignedLongValue() == 0xABCDEF);
unsigned long value6 = 0x90909090;
diff --git a/SoftHSMv2/src/lib/object_store/test/SessionObjectTests.cpp b/SoftHSMv2/src/lib/object_store/test/SessionObjectTests.cpp
index 6183ec6..20d9052 100644
--- a/SoftHSMv2/src/lib/object_store/test/SessionObjectTests.cpp
+++ b/SoftHSMv2/src/lib/object_store/test/SessionObjectTests.cpp
@@ -125,7 +125,7 @@ void SessionObjectTests::testULongAttr()
CPPUNIT_ASSERT(testObject.setAttribute(CKA_MODULUS_BITS, attr1));
CPPUNIT_ASSERT(testObject.setAttribute(CKA_PRIME_BITS, attr2));
CPPUNIT_ASSERT(testObject.setAttribute(CKA_AUTH_PIN_FLAGS, attr3));
- CPPUNIT_ASSERT(testObject.setAttribute(CKA_SUBPRIME_BITS, attr4));
+ CPPUNIT_ASSERT(testObject.setAttribute(CKA_SUB_PRIME_BITS, attr4));
CPPUNIT_ASSERT(testObject.setAttribute(CKA_KEY_TYPE, attr5));
CPPUNIT_ASSERT(testObject.isValid());
@@ -133,20 +133,20 @@ void SessionObjectTests::testULongAttr()
CPPUNIT_ASSERT(testObject.attributeExists(CKA_MODULUS_BITS));
CPPUNIT_ASSERT(testObject.attributeExists(CKA_PRIME_BITS));
CPPUNIT_ASSERT(testObject.attributeExists(CKA_AUTH_PIN_FLAGS));
- CPPUNIT_ASSERT(testObject.attributeExists(CKA_SUBPRIME_BITS));
+ CPPUNIT_ASSERT(testObject.attributeExists(CKA_SUB_PRIME_BITS));
CPPUNIT_ASSERT(testObject.attributeExists(CKA_KEY_TYPE));
CPPUNIT_ASSERT(!testObject.attributeExists(CKA_ID));
CPPUNIT_ASSERT(testObject.getAttribute(CKA_MODULUS_BITS).isUnsignedLongAttribute());
CPPUNIT_ASSERT(testObject.getAttribute(CKA_PRIME_BITS).isUnsignedLongAttribute());
CPPUNIT_ASSERT(testObject.getAttribute(CKA_AUTH_PIN_FLAGS).isUnsignedLongAttribute());
- CPPUNIT_ASSERT(testObject.getAttribute(CKA_SUBPRIME_BITS).isUnsignedLongAttribute());
+ CPPUNIT_ASSERT(testObject.getAttribute(CKA_SUB_PRIME_BITS).isUnsignedLongAttribute());
CPPUNIT_ASSERT(testObject.getAttribute(CKA_KEY_TYPE).isUnsignedLongAttribute());
CPPUNIT_ASSERT(testObject.getAttribute(CKA_MODULUS_BITS).getUnsignedLongValue() == 0x12345678);
CPPUNIT_ASSERT(testObject.getAttribute(CKA_PRIME_BITS).getUnsignedLongValue() == 0x87654321);
CPPUNIT_ASSERT(testObject.getAttribute(CKA_AUTH_PIN_FLAGS).getUnsignedLongValue() == 0x01010101);
- CPPUNIT_ASSERT(testObject.getAttribute(CKA_SUBPRIME_BITS).getUnsignedLongValue() == 0x10101010);
+ CPPUNIT_ASSERT(testObject.getAttribute(CKA_SUB_PRIME_BITS).getUnsignedLongValue() == 0x10101010);
CPPUNIT_ASSERT(testObject.getAttribute(CKA_KEY_TYPE).getUnsignedLongValue() == 0xABCDEF);
unsigned long value6 = 0x90909090;