diff options
| author | NoƩ Lopez <noelopez@free.fr> | 2026-03-15 16:46:56 +0100 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2026-03-22 09:43:40 +0100 |
| commit | b724894fa83df936154ed06a2e93190d367dbf08 (patch) | |
| tree | 18c9b6465cbeb6f5fbec36362c542effb373193d | |
| parent | e4bbafdf63a2d26c91453d585d43052413c50a9e (diff) | |
gnu: softhsm: Update to 2.7.0.
* gnu/packages/security-token.scm (softhsm): Update to 2.7.0.
[source]: Switch to git source.
[inputs]: Add autoconf, automake, and libtool. Sort alphabetically.
Change-Id: I4c1dd367b76dad448b32fb300d4f9707335497f5
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/patches/softhsm-fix-openssl3-tests.patch | 1107 | ||||
| -rw-r--r-- | gnu/packages/security-token.scm | 21 |
3 files changed, 13 insertions, 1116 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 6455e9feb3d..1b24c27c805 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -2439,7 +2439,6 @@ dist_patch_DATA = \ | |||
| 2439 | %D%/packages/patches/snappy-add-inline-for-GCC.patch \ | 2439 | %D%/packages/patches/snappy-add-inline-for-GCC.patch \ |
| 2440 | %D%/packages/patches/source-highlight-gcc-compat.patch \ | 2440 | %D%/packages/patches/source-highlight-gcc-compat.patch \ |
| 2441 | %D%/packages/patches/sourcetrail-fix-cmakelists-and-paths.patch \ | 2441 | %D%/packages/patches/sourcetrail-fix-cmakelists-and-paths.patch \ |
| 2442 | %D%/packages/patches/softhsm-fix-openssl3-tests.patch \ | ||
| 2443 | %D%/packages/patches/spectre-meltdown-checker-externalize-fwdb.patch \ | 2442 | %D%/packages/patches/spectre-meltdown-checker-externalize-fwdb.patch \ |
| 2444 | %D%/packages/patches/sphinxbase-fix-doxygen.patch \ | 2443 | %D%/packages/patches/sphinxbase-fix-doxygen.patch \ |
| 2445 | %D%/packages/patches/spice-vdagent-monitor-size-calculation.patch \ | 2444 | %D%/packages/patches/spice-vdagent-monitor-size-calculation.patch \ |
diff --git a/gnu/packages/patches/softhsm-fix-openssl3-tests.patch b/gnu/packages/patches/softhsm-fix-openssl3-tests.patch deleted file mode 100644 index f2d9ce3f5d6..00000000000 --- a/gnu/packages/patches/softhsm-fix-openssl3-tests.patch +++ /dev/null | |||
| @@ -1,1107 +0,0 @@ | |||
| 1 | Copied from Debian: | ||
| 2 | |||
| 3 | https://sources.debian.org/patches/softhsm2/2.6.1-2.1/0003-fix-ftbfs-with-opensslv3.patch/ | ||
| 4 | |||
| 5 | From 643f061e6fbe04552a2c49bd00528e61a9a77064 Mon Sep 17 00:00:00 2001 | ||
| 6 | From: Alexander Bokovoy <abokovoy@redhat.com> | ||
| 7 | Date: Wed, 26 May 2021 20:03:25 +0300 | ||
| 8 | Subject: [PATCH 1/4] openssl 3.0: Run DES tests only if OpenSSL allows it | ||
| 9 | |||
| 10 | OpenSSL 3.0 moves DES into a legacy provider which has to be loaded | ||
| 11 | explicitly. By default, it will not be loaded and DES methods in tests | ||
| 12 | will fail. Nest test blocks under successful initialization. | ||
| 13 | |||
| 14 | Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com> | ||
| 15 | --- | ||
| 16 | src/lib/crypto/test/DESTests.cpp | 350 ++++++++++++++++--------------- | ||
| 17 | 1 file changed, 182 insertions(+), 168 deletions(-) | ||
| 18 | |||
| 19 | Index: softhsm2-2.6.1/src/lib/crypto/test/DESTests.cpp | ||
| 20 | =================================================================== | ||
| 21 | --- softhsm2-2.6.1.orig/src/lib/crypto/test/DESTests.cpp | ||
| 22 | +++ softhsm2-2.6.1/src/lib/crypto/test/DESTests.cpp | ||
| 23 | @@ -259,54 +259,58 @@ | ||
| 24 | |||
| 25 | // Now, do the same thing using our DES implementation | ||
| 26 | shsmCipherText.wipe(); | ||
| 27 | - CPPUNIT_ASSERT(des->encryptInit(&desKey56, SymMode::CBC, IV)); | ||
| 28 | + if (des->encryptInit(&desKey56, SymMode::CBC, IV)) { | ||
| 29 | |||
| 30 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 31 | - shsmCipherText += OB; | ||
| 32 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 33 | + shsmCipherText += OB; | ||
| 34 | |||
| 35 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 36 | - shsmCipherText += OB; | ||
| 37 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 38 | + shsmCipherText += OB; | ||
| 39 | |||
| 40 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 41 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 42 | |||
| 43 | - // Check that we can get the plain text | ||
| 44 | - shsmPlainText.wipe(); | ||
| 45 | - CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::CBC, IV)); | ||
| 46 | + // Check that we can get the plain text | ||
| 47 | + shsmPlainText.wipe(); | ||
| 48 | + CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::CBC, IV)); | ||
| 49 | |||
| 50 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 51 | - shsmPlainText += OB; | ||
| 52 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 53 | + shsmPlainText += OB; | ||
| 54 | |||
| 55 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 56 | - shsmPlainText += OB; | ||
| 57 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 58 | + shsmPlainText += OB; | ||
| 59 | |||
| 60 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 61 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 62 | + | ||
| 63 | + } | ||
| 64 | |||
| 65 | // Test 112-bit key | ||
| 66 | cipherText = ByteString(testResult[i][j][1]); | ||
| 67 | |||
| 68 | // Now, do the same thing using our DES implementation | ||
| 69 | shsmCipherText.wipe(); | ||
| 70 | - CPPUNIT_ASSERT(des->encryptInit(&desKey112, SymMode::CBC, IV)); | ||
| 71 | + if (des->encryptInit(&desKey112, SymMode::CBC, IV)) { | ||
| 72 | |||
| 73 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 74 | - shsmCipherText += OB; | ||
| 75 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 76 | + shsmCipherText += OB; | ||
| 77 | |||
| 78 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 79 | - shsmCipherText += OB; | ||
| 80 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 81 | + shsmCipherText += OB; | ||
| 82 | |||
| 83 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 84 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 85 | |||
| 86 | - // Check that we can get the plain text | ||
| 87 | - shsmPlainText.wipe(); | ||
| 88 | - CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::CBC, IV)); | ||
| 89 | + // Check that we can get the plain text | ||
| 90 | + shsmPlainText.wipe(); | ||
| 91 | + CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::CBC, IV)); | ||
| 92 | |||
| 93 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 94 | - shsmPlainText += OB; | ||
| 95 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 96 | + shsmPlainText += OB; | ||
| 97 | |||
| 98 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 99 | - shsmPlainText += OB; | ||
| 100 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 101 | + shsmPlainText += OB; | ||
| 102 | + | ||
| 103 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 104 | + } | ||
| 105 | |||
| 106 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 107 | #endif | ||
| 108 | |||
| 109 | // Test 168-bit key | ||
| 110 | @@ -314,27 +318,28 @@ | ||
| 111 | |||
| 112 | // Now, do the same thing using our DES implementation | ||
| 113 | shsmCipherText.wipe(); | ||
| 114 | - CPPUNIT_ASSERT(des->encryptInit(&desKey168, SymMode::CBC, IV)); | ||
| 115 | + if (des->encryptInit(&desKey168, SymMode::CBC, IV)) { | ||
| 116 | |||
| 117 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 118 | - shsmCipherText += OB; | ||
| 119 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 120 | + shsmCipherText += OB; | ||
| 121 | |||
| 122 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 123 | - shsmCipherText += OB; | ||
| 124 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 125 | + shsmCipherText += OB; | ||
| 126 | |||
| 127 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 128 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 129 | |||
| 130 | - // Check that we can get the plain text | ||
| 131 | - shsmPlainText.wipe(); | ||
| 132 | - CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::CBC, IV)); | ||
| 133 | + // Check that we can get the plain text | ||
| 134 | + shsmPlainText.wipe(); | ||
| 135 | + CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::CBC, IV)); | ||
| 136 | |||
| 137 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 138 | - shsmPlainText += OB; | ||
| 139 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 140 | + shsmPlainText += OB; | ||
| 141 | |||
| 142 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 143 | - shsmPlainText += OB; | ||
| 144 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 145 | + shsmPlainText += OB; | ||
| 146 | |||
| 147 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 148 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 149 | + } | ||
| 150 | } | ||
| 151 | } | ||
| 152 | } | ||
| 153 | @@ -534,54 +539,56 @@ | ||
| 154 | |||
| 155 | // Now, do the same thing using our DES implementation | ||
| 156 | shsmCipherText.wipe(); | ||
| 157 | - CPPUNIT_ASSERT(des->encryptInit(&desKey56, SymMode::ECB, IV)); | ||
| 158 | + if (des->encryptInit(&desKey56, SymMode::ECB, IV)) { | ||
| 159 | |||
| 160 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 161 | - shsmCipherText += OB; | ||
| 162 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 163 | + shsmCipherText += OB; | ||
| 164 | |||
| 165 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 166 | - shsmCipherText += OB; | ||
| 167 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 168 | + shsmCipherText += OB; | ||
| 169 | |||
| 170 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 171 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 172 | |||
| 173 | - // Check that we can get the plain text | ||
| 174 | - shsmPlainText.wipe(); | ||
| 175 | - CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::ECB, IV)); | ||
| 176 | + // Check that we can get the plain text | ||
| 177 | + shsmPlainText.wipe(); | ||
| 178 | + CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::ECB, IV)); | ||
| 179 | |||
| 180 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 181 | - shsmPlainText += OB; | ||
| 182 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 183 | + shsmPlainText += OB; | ||
| 184 | |||
| 185 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 186 | - shsmPlainText += OB; | ||
| 187 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 188 | + shsmPlainText += OB; | ||
| 189 | |||
| 190 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 191 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 192 | + } | ||
| 193 | |||
| 194 | // Test 112-bit key | ||
| 195 | cipherText = ByteString(testResult[i][j][1]); | ||
| 196 | |||
| 197 | // Now, do the same thing using our DES implementation | ||
| 198 | shsmCipherText.wipe(); | ||
| 199 | - CPPUNIT_ASSERT(des->encryptInit(&desKey112, SymMode::ECB, IV)); | ||
| 200 | + if (des->encryptInit(&desKey112, SymMode::ECB, IV)) { | ||
| 201 | |||
| 202 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 203 | - shsmCipherText += OB; | ||
| 204 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 205 | + shsmCipherText += OB; | ||
| 206 | |||
| 207 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 208 | - shsmCipherText += OB; | ||
| 209 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 210 | + shsmCipherText += OB; | ||
| 211 | |||
| 212 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 213 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 214 | |||
| 215 | - // Check that we can get the plain text | ||
| 216 | - shsmPlainText.wipe(); | ||
| 217 | - CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::ECB, IV)); | ||
| 218 | + // Check that we can get the plain text | ||
| 219 | + shsmPlainText.wipe(); | ||
| 220 | + CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::ECB, IV)); | ||
| 221 | |||
| 222 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 223 | - shsmPlainText += OB; | ||
| 224 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 225 | + shsmPlainText += OB; | ||
| 226 | |||
| 227 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 228 | - shsmPlainText += OB; | ||
| 229 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 230 | + shsmPlainText += OB; | ||
| 231 | |||
| 232 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 233 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 234 | + } | ||
| 235 | #endif | ||
| 236 | |||
| 237 | // Test 168-bit key | ||
| 238 | @@ -589,27 +596,28 @@ | ||
| 239 | |||
| 240 | // Now, do the same thing using our DES implementation | ||
| 241 | shsmCipherText.wipe(); | ||
| 242 | - CPPUNIT_ASSERT(des->encryptInit(&desKey168, SymMode::ECB, IV)); | ||
| 243 | + if (des->encryptInit(&desKey168, SymMode::ECB, IV)) { | ||
| 244 | |||
| 245 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 246 | - shsmCipherText += OB; | ||
| 247 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 248 | + shsmCipherText += OB; | ||
| 249 | |||
| 250 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 251 | - shsmCipherText += OB; | ||
| 252 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 253 | + shsmCipherText += OB; | ||
| 254 | |||
| 255 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 256 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 257 | |||
| 258 | - // Check that we can get the plain text | ||
| 259 | - shsmPlainText.wipe(); | ||
| 260 | - CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::ECB, IV)); | ||
| 261 | + // Check that we can get the plain text | ||
| 262 | + shsmPlainText.wipe(); | ||
| 263 | + CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::ECB, IV)); | ||
| 264 | |||
| 265 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 266 | - shsmPlainText += OB; | ||
| 267 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 268 | + shsmPlainText += OB; | ||
| 269 | |||
| 270 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 271 | - shsmPlainText += OB; | ||
| 272 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 273 | + shsmPlainText += OB; | ||
| 274 | |||
| 275 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 276 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 277 | + } | ||
| 278 | } | ||
| 279 | } | ||
| 280 | } | ||
| 281 | @@ -809,54 +817,56 @@ | ||
| 282 | |||
| 283 | // Now, do the same thing using our DES implementation | ||
| 284 | shsmCipherText.wipe(); | ||
| 285 | - CPPUNIT_ASSERT(des->encryptInit(&desKey56, SymMode::OFB, IV)); | ||
| 286 | + if (des->encryptInit(&desKey56, SymMode::OFB, IV)) { | ||
| 287 | |||
| 288 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 289 | - shsmCipherText += OB; | ||
| 290 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 291 | + shsmCipherText += OB; | ||
| 292 | |||
| 293 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 294 | - shsmCipherText += OB; | ||
| 295 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 296 | + shsmCipherText += OB; | ||
| 297 | |||
| 298 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 299 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 300 | |||
| 301 | - // Check that we can get the plain text | ||
| 302 | - shsmPlainText.wipe(); | ||
| 303 | - CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::OFB, IV)); | ||
| 304 | + // Check that we can get the plain text | ||
| 305 | + shsmPlainText.wipe(); | ||
| 306 | + CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::OFB, IV)); | ||
| 307 | |||
| 308 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 309 | - shsmPlainText += OB; | ||
| 310 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 311 | + shsmPlainText += OB; | ||
| 312 | |||
| 313 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 314 | - shsmPlainText += OB; | ||
| 315 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 316 | + shsmPlainText += OB; | ||
| 317 | |||
| 318 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 319 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 320 | + } | ||
| 321 | |||
| 322 | // Test 112-bit key | ||
| 323 | cipherText = ByteString(testResult[i][j][1]); | ||
| 324 | |||
| 325 | // Now, do the same thing using our DES implementation | ||
| 326 | shsmCipherText.wipe(); | ||
| 327 | - CPPUNIT_ASSERT(des->encryptInit(&desKey112, SymMode::OFB, IV)); | ||
| 328 | + if (des->encryptInit(&desKey112, SymMode::OFB, IV)) { | ||
| 329 | |||
| 330 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 331 | - shsmCipherText += OB; | ||
| 332 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 333 | + shsmCipherText += OB; | ||
| 334 | |||
| 335 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 336 | - shsmCipherText += OB; | ||
| 337 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 338 | + shsmCipherText += OB; | ||
| 339 | |||
| 340 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 341 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 342 | |||
| 343 | - // Check that we can get the plain text | ||
| 344 | - shsmPlainText.wipe(); | ||
| 345 | - CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::OFB, IV)); | ||
| 346 | + // Check that we can get the plain text | ||
| 347 | + shsmPlainText.wipe(); | ||
| 348 | + CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::OFB, IV)); | ||
| 349 | |||
| 350 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 351 | - shsmPlainText += OB; | ||
| 352 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 353 | + shsmPlainText += OB; | ||
| 354 | |||
| 355 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 356 | - shsmPlainText += OB; | ||
| 357 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 358 | + shsmPlainText += OB; | ||
| 359 | |||
| 360 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 361 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 362 | + } | ||
| 363 | #endif | ||
| 364 | |||
| 365 | // Test 168-bit key | ||
| 366 | @@ -864,27 +874,28 @@ | ||
| 367 | |||
| 368 | // Now, do the same thing using our DES implementation | ||
| 369 | shsmCipherText.wipe(); | ||
| 370 | - CPPUNIT_ASSERT(des->encryptInit(&desKey168, SymMode::OFB, IV)); | ||
| 371 | + if (des->encryptInit(&desKey168, SymMode::OFB, IV)) { | ||
| 372 | |||
| 373 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 374 | - shsmCipherText += OB; | ||
| 375 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 376 | + shsmCipherText += OB; | ||
| 377 | |||
| 378 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 379 | - shsmCipherText += OB; | ||
| 380 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 381 | + shsmCipherText += OB; | ||
| 382 | |||
| 383 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 384 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 385 | |||
| 386 | - // Check that we can get the plain text | ||
| 387 | - shsmPlainText.wipe(); | ||
| 388 | - CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::OFB, IV)); | ||
| 389 | + // Check that we can get the plain text | ||
| 390 | + shsmPlainText.wipe(); | ||
| 391 | + CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::OFB, IV)); | ||
| 392 | |||
| 393 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 394 | - shsmPlainText += OB; | ||
| 395 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 396 | + shsmPlainText += OB; | ||
| 397 | |||
| 398 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 399 | - shsmPlainText += OB; | ||
| 400 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 401 | + shsmPlainText += OB; | ||
| 402 | |||
| 403 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 404 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 405 | + } | ||
| 406 | } | ||
| 407 | } | ||
| 408 | } | ||
| 409 | @@ -1083,54 +1094,56 @@ | ||
| 410 | |||
| 411 | // Now, do the same thing using our DES implementation | ||
| 412 | shsmCipherText.wipe(); | ||
| 413 | - CPPUNIT_ASSERT(des->encryptInit(&desKey56, SymMode::CFB, IV)); | ||
| 414 | + if (des->encryptInit(&desKey56, SymMode::CFB, IV)) { | ||
| 415 | |||
| 416 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 417 | - shsmCipherText += OB; | ||
| 418 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 419 | + shsmCipherText += OB; | ||
| 420 | |||
| 421 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 422 | - shsmCipherText += OB; | ||
| 423 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 424 | + shsmCipherText += OB; | ||
| 425 | |||
| 426 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 427 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 428 | |||
| 429 | - // Check that we can get the plain text | ||
| 430 | - shsmPlainText.wipe(); | ||
| 431 | - CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::CFB, IV)); | ||
| 432 | + // Check that we can get the plain text | ||
| 433 | + shsmPlainText.wipe(); | ||
| 434 | + CPPUNIT_ASSERT(des->decryptInit(&desKey56, SymMode::CFB, IV)); | ||
| 435 | |||
| 436 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 437 | - shsmPlainText += OB; | ||
| 438 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 439 | + shsmPlainText += OB; | ||
| 440 | |||
| 441 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 442 | - shsmPlainText += OB; | ||
| 443 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 444 | + shsmPlainText += OB; | ||
| 445 | |||
| 446 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 447 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 448 | + } | ||
| 449 | |||
| 450 | // Test 112-bit key | ||
| 451 | cipherText = ByteString(testResult[i][j][1]); | ||
| 452 | |||
| 453 | // Now, do the same thing using our DES implementation | ||
| 454 | shsmCipherText.wipe(); | ||
| 455 | - CPPUNIT_ASSERT(des->encryptInit(&desKey112, SymMode::CFB, IV)); | ||
| 456 | + if (des->encryptInit(&desKey112, SymMode::CFB, IV)) { | ||
| 457 | |||
| 458 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 459 | - shsmCipherText += OB; | ||
| 460 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 461 | + shsmCipherText += OB; | ||
| 462 | |||
| 463 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 464 | - shsmCipherText += OB; | ||
| 465 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 466 | + shsmCipherText += OB; | ||
| 467 | |||
| 468 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 469 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 470 | |||
| 471 | - // Check that we can get the plain text | ||
| 472 | - shsmPlainText.wipe(); | ||
| 473 | - CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::CFB, IV)); | ||
| 474 | + // Check that we can get the plain text | ||
| 475 | + shsmPlainText.wipe(); | ||
| 476 | + CPPUNIT_ASSERT(des->decryptInit(&desKey112, SymMode::CFB, IV)); | ||
| 477 | |||
| 478 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 479 | - shsmPlainText += OB; | ||
| 480 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 481 | + shsmPlainText += OB; | ||
| 482 | |||
| 483 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 484 | - shsmPlainText += OB; | ||
| 485 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 486 | + shsmPlainText += OB; | ||
| 487 | |||
| 488 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 489 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 490 | + } | ||
| 491 | #endif | ||
| 492 | |||
| 493 | // Test 168-bit key | ||
| 494 | @@ -1138,27 +1151,28 @@ | ||
| 495 | |||
| 496 | // Now, do the same thing using our DES implementation | ||
| 497 | shsmCipherText.wipe(); | ||
| 498 | - CPPUNIT_ASSERT(des->encryptInit(&desKey168, SymMode::CFB, IV)); | ||
| 499 | + if (des->encryptInit(&desKey168, SymMode::CFB, IV)) { | ||
| 500 | |||
| 501 | - CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 502 | - shsmCipherText += OB; | ||
| 503 | + CPPUNIT_ASSERT(des->encryptUpdate(plainText, OB)); | ||
| 504 | + shsmCipherText += OB; | ||
| 505 | |||
| 506 | - CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 507 | - shsmCipherText += OB; | ||
| 508 | + CPPUNIT_ASSERT(des->encryptFinal(OB)); | ||
| 509 | + shsmCipherText += OB; | ||
| 510 | |||
| 511 | - CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 512 | + CPPUNIT_ASSERT(shsmCipherText == cipherText); | ||
| 513 | |||
| 514 | - // Check that we can get the plain text | ||
| 515 | - shsmPlainText.wipe(); | ||
| 516 | - CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::CFB, IV)); | ||
| 517 | + // Check that we can get the plain text | ||
| 518 | + shsmPlainText.wipe(); | ||
| 519 | + CPPUNIT_ASSERT(des->decryptInit(&desKey168, SymMode::CFB, IV)); | ||
| 520 | |||
| 521 | - CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 522 | - shsmPlainText += OB; | ||
| 523 | + CPPUNIT_ASSERT(des->decryptUpdate(shsmCipherText, OB)); | ||
| 524 | + shsmPlainText += OB; | ||
| 525 | |||
| 526 | - CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 527 | - shsmPlainText += OB; | ||
| 528 | + CPPUNIT_ASSERT(des->decryptFinal(OB)); | ||
| 529 | + shsmPlainText += OB; | ||
| 530 | |||
| 531 | - CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 532 | + CPPUNIT_ASSERT(shsmPlainText == plainText); | ||
| 533 | + } | ||
| 534 | } | ||
| 535 | } | ||
| 536 | } | ||
| 537 | Index: softhsm2-2.6.1/src/lib/crypto/test/RSATests.cpp | ||
| 538 | =================================================================== | ||
| 539 | --- softhsm2-2.6.1.orig/src/lib/crypto/test/RSATests.cpp | ||
| 540 | +++ softhsm2-2.6.1/src/lib/crypto/test/RSATests.cpp | ||
| 541 | @@ -78,7 +78,6 @@ | ||
| 542 | |||
| 543 | // Key sizes to test | ||
| 544 | std::vector<size_t> keySizes; | ||
| 545 | - keySizes.push_back(1024); | ||
| 546 | #ifndef WITH_FIPS | ||
| 547 | keySizes.push_back(1025); | ||
| 548 | #endif | ||
| 549 | @@ -93,30 +92,31 @@ | ||
| 550 | p.setE(*e); | ||
| 551 | p.setBitLength(*k); | ||
| 552 | |||
| 553 | - // Generate key-pair | ||
| 554 | - CPPUNIT_ASSERT(rsa->generateKeyPair(&kp, &p)); | ||
| 555 | + // Generate key-pair but skip test if key size is unsupported in OpenSSL 3.0.0 | ||
| 556 | + if (rsa->generateKeyPair(&kp, &p)) { | ||
| 557 | |||
| 558 | - RSAPublicKey* pub = (RSAPublicKey*) kp->getPublicKey(); | ||
| 559 | - RSAPrivateKey* priv = (RSAPrivateKey*) kp->getPrivateKey(); | ||
| 560 | + RSAPublicKey* pub = (RSAPublicKey*) kp->getPublicKey(); | ||
| 561 | + RSAPrivateKey* priv = (RSAPrivateKey*) kp->getPrivateKey(); | ||
| 562 | |||
| 563 | - CPPUNIT_ASSERT(pub->getBitLength() == *k); | ||
| 564 | - CPPUNIT_ASSERT(priv->getBitLength() == *k); | ||
| 565 | - CPPUNIT_ASSERT(pub->getE() == *e); | ||
| 566 | - CPPUNIT_ASSERT(priv->getE() == *e); | ||
| 567 | + CPPUNIT_ASSERT(pub->getBitLength() == *k); | ||
| 568 | + CPPUNIT_ASSERT(priv->getBitLength() == *k); | ||
| 569 | + CPPUNIT_ASSERT(pub->getE() == *e); | ||
| 570 | + CPPUNIT_ASSERT(priv->getE() == *e); | ||
| 571 | |||
| 572 | - rsa->recycleKeyPair(kp); | ||
| 573 | + rsa->recycleKeyPair(kp); | ||
| 574 | + } | ||
| 575 | } | ||
| 576 | } | ||
| 577 | } | ||
| 578 | |||
| 579 | void RSATests::testSerialisation() | ||
| 580 | { | ||
| 581 | - // Generate a 1024-bit key-pair for testing | ||
| 582 | + // Generate a 2048-bit key-pair for testing | ||
| 583 | AsymmetricKeyPair* kp; | ||
| 584 | RSAParameters p; | ||
| 585 | |||
| 586 | p.setE("010001"); | ||
| 587 | - p.setBitLength(1024); | ||
| 588 | + p.setBitLength(2048); | ||
| 589 | |||
| 590 | CPPUNIT_ASSERT(rsa->generateKeyPair(&kp, &p)); | ||
| 591 | CPPUNIT_ASSERT(kp != NULL); | ||
| 592 | @@ -204,12 +204,12 @@ | ||
| 593 | |||
| 594 | void RSATests::testPKCS8() | ||
| 595 | { | ||
| 596 | - // Generate a 1024-bit key-pair for testing | ||
| 597 | + // Generate a 2048-bit key-pair for testing | ||
| 598 | AsymmetricKeyPair* kp; | ||
| 599 | RSAParameters p; | ||
| 600 | |||
| 601 | p.setE("010001"); | ||
| 602 | - p.setBitLength(1024); | ||
| 603 | + p.setBitLength(2048); | ||
| 604 | |||
| 605 | CPPUNIT_ASSERT(rsa->generateKeyPair(&kp, &p)); | ||
| 606 | CPPUNIT_ASSERT(kp != NULL); | ||
| 607 | @@ -253,7 +253,6 @@ | ||
| 608 | |||
| 609 | // Key sizes to test | ||
| 610 | std::vector<size_t> keySizes; | ||
| 611 | - keySizes.push_back(1024); | ||
| 612 | keySizes.push_back(1280); | ||
| 613 | keySizes.push_back(2048); | ||
| 614 | //keySizes.push_back(4096); | ||
| 615 | @@ -293,8 +292,10 @@ | ||
| 616 | p.setE(*e); | ||
| 617 | p.setBitLength(*k); | ||
| 618 | |||
| 619 | - // Generate key-pair | ||
| 620 | - CPPUNIT_ASSERT(rsa->generateKeyPair(&kp, &p)); | ||
| 621 | + // Generate key-pair but skip those that unsupported in OpenSSL 3.0.0 | ||
| 622 | + if (!rsa->generateKeyPair(&kp, &p)) { | ||
| 623 | + continue; | ||
| 624 | + } | ||
| 625 | |||
| 626 | // Generate some data to sign | ||
| 627 | ByteString dataToSign; | ||
| 628 | @@ -611,7 +612,6 @@ | ||
| 629 | |||
| 630 | // Key sizes to test | ||
| 631 | std::vector<size_t> keySizes; | ||
| 632 | - keySizes.push_back(1024); | ||
| 633 | keySizes.push_back(1280); | ||
| 634 | keySizes.push_back(2048); | ||
| 635 | //keySizes.push_back(4096); | ||
| 636 | @@ -629,8 +629,10 @@ | ||
| 637 | p.setE(*e); | ||
| 638 | p.setBitLength(*k); | ||
| 639 | |||
| 640 | - // Generate key-pair | ||
| 641 | - CPPUNIT_ASSERT(rsa->generateKeyPair(&kp, &p)); | ||
| 642 | + // Generate key-pair but skip those that unsupported in OpenSSL 3.0.0 | ||
| 643 | + if (!rsa->generateKeyPair(&kp, &p)) { | ||
| 644 | + continue; | ||
| 645 | + } | ||
| 646 | |||
| 647 | RNG* rng = CryptoFactory::i()->getRNG(); | ||
| 648 | |||
| 649 | Index: softhsm2-2.6.1/src/lib/test/DeriveTests.cpp | ||
| 650 | =================================================================== | ||
| 651 | --- softhsm2-2.6.1.orig/src/lib/test/DeriveTests.cpp | ||
| 652 | +++ softhsm2-2.6.1/src/lib/test/DeriveTests.cpp | ||
| 653 | @@ -642,11 +642,14 @@ | ||
| 654 | 0x25, 0x26, 0x27, 0x28, 0x29, 0x30, 0x31, 0x32 | ||
| 655 | }; | ||
| 656 | CK_ULONG secLen = 0; | ||
| 657 | + CK_BBOOL oldMechs = CK_FALSE; | ||
| 658 | |||
| 659 | switch (mechType) | ||
| 660 | { | ||
| 661 | case CKM_DES_ECB_ENCRYPT_DATA: | ||
| 662 | case CKM_DES3_ECB_ENCRYPT_DATA: | ||
| 663 | + oldMechs = CK_TRUE; | ||
| 664 | + /* fall-through */ | ||
| 665 | case CKM_AES_ECB_ENCRYPT_DATA: | ||
| 666 | param1.pData = &data[0]; | ||
| 667 | param1.ulLen = sizeof(data); | ||
| 668 | @@ -655,6 +658,7 @@ | ||
| 669 | break; | ||
| 670 | case CKM_DES_CBC_ENCRYPT_DATA: | ||
| 671 | case CKM_DES3_CBC_ENCRYPT_DATA: | ||
| 672 | + oldMechs = CK_TRUE; | ||
| 673 | memcpy(param2.iv, "12345678", 8); | ||
| 674 | param2.pData = &data[0]; | ||
| 675 | param2.length = sizeof(data); | ||
| 676 | @@ -679,10 +683,12 @@ | ||
| 677 | break; | ||
| 678 | case CKK_DES: | ||
| 679 | mechEncrypt.mechanism = CKM_DES_ECB; | ||
| 680 | + oldMechs = CK_TRUE; | ||
| 681 | break; | ||
| 682 | case CKK_DES2: | ||
| 683 | case CKK_DES3: | ||
| 684 | mechEncrypt.mechanism = CKM_DES3_ECB; | ||
| 685 | + oldMechs = CK_TRUE; | ||
| 686 | break; | ||
| 687 | case CKK_AES: | ||
| 688 | mechEncrypt.mechanism = CKM_AES_ECB; | ||
| 689 | @@ -719,7 +725,11 @@ | ||
| 690 | keyAttribs, sizeof(keyAttribs)/sizeof(CK_ATTRIBUTE) - 1, | ||
| 691 | &hDerive) ); | ||
| 692 | } | ||
| 693 | - CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 694 | + if (rv != CKR_OK && oldMechs == CK_TRUE) { | ||
| 695 | + // Skip old mechanisms, they don't work under this crypto library | ||
| 696 | + return; | ||
| 697 | + } | ||
| 698 | + CPPUNIT_ASSERT(rv==CKR_OK); | ||
| 699 | |||
| 700 | // Check that KCV has been set | ||
| 701 | CK_ATTRIBUTE checkAttribs[] = { | ||
| 702 | @@ -740,6 +750,10 @@ | ||
| 703 | CK_ULONG ulRecoveredTextLen; | ||
| 704 | |||
| 705 | rv = CRYPTOKI_F_PTR( C_EncryptInit(hSession,&mechEncrypt,hDerive) ); | ||
| 706 | + if (rv != CKR_OK && oldMechs == CK_TRUE) { | ||
| 707 | + // Skip old mechanisms, they don't work under this crypto library | ||
| 708 | + return; | ||
| 709 | + } | ||
| 710 | CPPUNIT_ASSERT(rv==CKR_OK); | ||
| 711 | |||
| 712 | ulCipherTextLen = sizeof(cipherText); | ||
| 713 | Index: softhsm2-2.6.1/src/lib/test/ObjectTests.cpp | ||
| 714 | =================================================================== | ||
| 715 | --- softhsm2-2.6.1.orig/src/lib/test/ObjectTests.cpp | ||
| 716 | +++ softhsm2-2.6.1/src/lib/test/ObjectTests.cpp | ||
| 717 | @@ -2370,8 +2370,10 @@ | ||
| 718 | CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 719 | rv = CRYPTOKI_F_PTR( C_GetAttributeValue(hSession, hObject, attribKCV, 1) ); | ||
| 720 | CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 721 | - CPPUNIT_ASSERT(attribKCV[0].ulValueLen == 3); | ||
| 722 | - CPPUNIT_ASSERT(memcmp(pCheckValue, desKCV, 3) == 0); | ||
| 723 | + // If DES key is not supported, skip it | ||
| 724 | + if (attribKCV[0].ulValueLen == 3) { | ||
| 725 | + CPPUNIT_ASSERT(memcmp(pCheckValue, desKCV, 3) == 0); | ||
| 726 | + } | ||
| 727 | rv = CRYPTOKI_F_PTR( C_DestroyObject(hSession,hObject) ); | ||
| 728 | CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 729 | |||
| 730 | @@ -2381,9 +2383,12 @@ | ||
| 731 | rv = CRYPTOKI_F_PTR( C_CreateObject(hSession, attribs, sizeof(attribs)/sizeof(CK_ATTRIBUTE), &hObject) ); | ||
| 732 | CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 733 | rv = CRYPTOKI_F_PTR( C_GetAttributeValue(hSession, hObject, attribKCV, 1) ); | ||
| 734 | - CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 735 | - CPPUNIT_ASSERT(attribKCV[0].ulValueLen == 3); | ||
| 736 | - CPPUNIT_ASSERT(memcmp(pCheckValue, des2KCV, 3) == 0); | ||
| 737 | + // If DES2 key is not supported, skip it | ||
| 738 | + if (rv == CKR_OK) { | ||
| 739 | + if (attribKCV[0].ulValueLen == 3) { | ||
| 740 | + CPPUNIT_ASSERT(memcmp(pCheckValue, des2KCV, 3) == 0); | ||
| 741 | + } | ||
| 742 | + } | ||
| 743 | rv = CRYPTOKI_F_PTR( C_DestroyObject(hSession,hObject) ); | ||
| 744 | CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 745 | |||
| 746 | @@ -2394,8 +2399,10 @@ | ||
| 747 | CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 748 | rv = CRYPTOKI_F_PTR( C_GetAttributeValue(hSession, hObject, attribKCV, 1) ); | ||
| 749 | CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 750 | - CPPUNIT_ASSERT(attribKCV[0].ulValueLen == 3); | ||
| 751 | - CPPUNIT_ASSERT(memcmp(pCheckValue, des3KCV, 3) == 0); | ||
| 752 | + // If DES3 key is not supported, skip it | ||
| 753 | + if (attribKCV[0].ulValueLen == 3) { | ||
| 754 | + CPPUNIT_ASSERT(memcmp(pCheckValue, des3KCV, 3) == 0); | ||
| 755 | + } | ||
| 756 | rv = CRYPTOKI_F_PTR( C_DestroyObject(hSession,hObject) ); | ||
| 757 | CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 758 | } | ||
| 759 | Index: softhsm2-2.6.1/src/lib/test/SymmetricAlgorithmTests.cpp | ||
| 760 | =================================================================== | ||
| 761 | --- softhsm2-2.6.1.orig/src/lib/test/SymmetricAlgorithmTests.cpp | ||
| 762 | +++ softhsm2-2.6.1/src/lib/test/SymmetricAlgorithmTests.cpp | ||
| 763 | @@ -195,6 +195,8 @@ | ||
| 764 | std::vector<CK_BYTE> vEncryptedData; | ||
| 765 | std::vector<CK_BYTE> vEncryptedDataParted; | ||
| 766 | PartSize partSize(blockSize, &vData); | ||
| 767 | + CK_BBOOL oldMechs = CK_FALSE; | ||
| 768 | + CK_RV rv = CKR_OK; | ||
| 769 | |||
| 770 | CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_GenerateRandom(hSession, (CK_BYTE_PTR)&vData.front(), messageSize) ) ); | ||
| 771 | |||
| 772 | @@ -233,6 +235,8 @@ | ||
| 773 | case CKM_DES_CBC_PAD: | ||
| 774 | case CKM_DES3_CBC: | ||
| 775 | case CKM_DES3_CBC_PAD: | ||
| 776 | + oldMechs = CK_TRUE; | ||
| 777 | + /* fall-through */ | ||
| 778 | case CKM_AES_CBC: | ||
| 779 | case CKM_AES_CBC_PAD: | ||
| 780 | pMechanism->pParameter = (CK_VOID_PTR)&vData.front(); | ||
| 781 | @@ -246,12 +250,18 @@ | ||
| 782 | pMechanism->pParameter = &gcmParams; | ||
| 783 | pMechanism->ulParameterLen = sizeof(gcmParams); | ||
| 784 | break; | ||
| 785 | + case CKM_DES_ECB: | ||
| 786 | + case CKM_DES3_ECB: | ||
| 787 | + oldMechs = CK_TRUE; | ||
| 788 | + break; | ||
| 789 | default: | ||
| 790 | break; | ||
| 791 | } | ||
| 792 | |||
| 793 | // Single-part encryption | ||
| 794 | - CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptInit(hSession,pMechanism,hKey) ) ); | ||
| 795 | + rv = CRYPTOKI_F_PTR( C_EncryptInit(hSession,pMechanism,hKey) ); | ||
| 796 | + CPPUNIT_ASSERT_EQUAL( (CK_BBOOL) CK_FALSE, (CK_BBOOL) ((rv != CKR_OK) && (oldMechs == CK_FALSE)) ); | ||
| 797 | + if (oldMechs == CK_FALSE) | ||
| 798 | { | ||
| 799 | CK_ULONG ulEncryptedDataLen; | ||
| 800 | const CK_RV rv( CRYPTOKI_F_PTR( C_Encrypt(hSession,(CK_BYTE_PTR)&vData.front(),messageSize,NULL_PTR,&ulEncryptedDataLen) ) ); | ||
| 801 | @@ -267,40 +277,42 @@ | ||
| 802 | } | ||
| 803 | |||
| 804 | // Multi-part encryption | ||
| 805 | - CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptInit(hSession,pMechanism,hKey) ) ); | ||
| 806 | - | ||
| 807 | - for ( std::vector<CK_BYTE>::const_iterator i(vData.begin()); i<vData.end(); i+=partSize.getCurrent() ) { | ||
| 808 | - const CK_ULONG lPartLen( i+partSize.getNext()<vData.end() ? partSize.getCurrent() : vData.end()-i ); | ||
| 809 | - CK_ULONG ulEncryptedPartLen; | ||
| 810 | - CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptUpdate(hSession,(CK_BYTE_PTR)&(*i),lPartLen,NULL_PTR,&ulEncryptedPartLen) ) ); | ||
| 811 | - const size_t oldSize( vEncryptedDataParted.size() ); | ||
| 812 | - vEncryptedDataParted.resize(oldSize+ulEncryptedPartLen); | ||
| 813 | - CK_BYTE dummy; | ||
| 814 | - const CK_BYTE_PTR pEncryptedPart( ulEncryptedPartLen>0 ? &vEncryptedDataParted.at(oldSize) : &dummy ); | ||
| 815 | - CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptUpdate(hSession,(CK_BYTE_PTR)&(*i),lPartLen,pEncryptedPart,&ulEncryptedPartLen) ) ); | ||
| 816 | - vEncryptedDataParted.resize(oldSize+ulEncryptedPartLen); | ||
| 817 | - } | ||
| 818 | - { | ||
| 819 | - CK_ULONG ulLastEncryptedPartLen; | ||
| 820 | - const CK_RV rv( CRYPTOKI_F_PTR( C_EncryptFinal(hSession,NULL_PTR,&ulLastEncryptedPartLen) ) ); | ||
| 821 | - if ( isSizeOK ) { | ||
| 822 | - CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, rv ); | ||
| 823 | + rv = CRYPTOKI_F_PTR( C_EncryptInit(hSession,pMechanism,hKey) ); | ||
| 824 | + CPPUNIT_ASSERT_EQUAL( (CK_BBOOL) CK_FALSE, (CK_BBOOL) ((rv != CKR_OK) && (oldMechs == CK_FALSE)) ); | ||
| 825 | + if (oldMechs == CK_FALSE) { | ||
| 826 | + for ( std::vector<CK_BYTE>::const_iterator i(vData.begin()); i<vData.end(); i+=partSize.getCurrent() ) { | ||
| 827 | + const CK_ULONG lPartLen( i+partSize.getNext()<vData.end() ? partSize.getCurrent() : vData.end()-i ); | ||
| 828 | + CK_ULONG ulEncryptedPartLen; | ||
| 829 | + CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptUpdate(hSession,(CK_BYTE_PTR)&(*i),lPartLen,NULL_PTR,&ulEncryptedPartLen) ) ); | ||
| 830 | const size_t oldSize( vEncryptedDataParted.size() ); | ||
| 831 | + vEncryptedDataParted.resize(oldSize+ulEncryptedPartLen); | ||
| 832 | CK_BYTE dummy; | ||
| 833 | - vEncryptedDataParted.resize(oldSize+ulLastEncryptedPartLen); | ||
| 834 | - const CK_BYTE_PTR pLastEncryptedPart( ulLastEncryptedPartLen>0 ? &vEncryptedDataParted.at(oldSize) : &dummy ); | ||
| 835 | - CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptFinal(hSession,pLastEncryptedPart,&ulLastEncryptedPartLen) ) ); | ||
| 836 | - vEncryptedDataParted.resize(oldSize+ulLastEncryptedPartLen); | ||
| 837 | - } else { | ||
| 838 | - CPPUNIT_ASSERT_EQUAL_MESSAGE("C_EncryptFinal should fail with C_CKR_DATA_LEN_RANGE", (CK_RV)CKR_DATA_LEN_RANGE, rv); | ||
| 839 | - vEncryptedDataParted = vData; | ||
| 840 | + const CK_BYTE_PTR pEncryptedPart( ulEncryptedPartLen>0 ? &vEncryptedDataParted.at(oldSize) : &dummy ); | ||
| 841 | + CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptUpdate(hSession,(CK_BYTE_PTR)&(*i),lPartLen,pEncryptedPart,&ulEncryptedPartLen) ) ); | ||
| 842 | + vEncryptedDataParted.resize(oldSize+ulEncryptedPartLen); | ||
| 843 | + } | ||
| 844 | + { | ||
| 845 | + CK_ULONG ulLastEncryptedPartLen; | ||
| 846 | + const CK_RV rv( CRYPTOKI_F_PTR( C_EncryptFinal(hSession,NULL_PTR,&ulLastEncryptedPartLen) ) ); | ||
| 847 | + if ( isSizeOK ) { | ||
| 848 | + CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, rv ); | ||
| 849 | + const size_t oldSize( vEncryptedDataParted.size() ); | ||
| 850 | + CK_BYTE dummy; | ||
| 851 | + vEncryptedDataParted.resize(oldSize+ulLastEncryptedPartLen); | ||
| 852 | + const CK_BYTE_PTR pLastEncryptedPart( ulLastEncryptedPartLen>0 ? &vEncryptedDataParted.at(oldSize) : &dummy ); | ||
| 853 | + CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_EncryptFinal(hSession,pLastEncryptedPart,&ulLastEncryptedPartLen) ) ); | ||
| 854 | + vEncryptedDataParted.resize(oldSize+ulLastEncryptedPartLen); | ||
| 855 | + } else { | ||
| 856 | + CPPUNIT_ASSERT_EQUAL_MESSAGE("C_EncryptFinal should fail with C_CKR_DATA_LEN_RANGE", (CK_RV)CKR_DATA_LEN_RANGE, rv); | ||
| 857 | + vEncryptedDataParted = vData; | ||
| 858 | + } | ||
| 859 | } | ||
| 860 | } | ||
| 861 | |||
| 862 | // Single-part decryption | ||
| 863 | - CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_DecryptInit(hSession,pMechanism,hKey) ) ); | ||
| 864 | - | ||
| 865 | - { | ||
| 866 | + rv = CRYPTOKI_F_PTR( C_DecryptInit(hSession,pMechanism,hKey) ); | ||
| 867 | + CPPUNIT_ASSERT_EQUAL( (CK_BBOOL) CK_FALSE, (CK_BBOOL) ((rv != CKR_OK) && (oldMechs == CK_FALSE)) ); | ||
| 868 | + if (oldMechs == CK_FALSE) { | ||
| 869 | CK_ULONG ulDataLen; | ||
| 870 | const CK_RV rv( CRYPTOKI_F_PTR( C_Decrypt(hSession,&vEncryptedData.front(),vEncryptedData.size(),NULL_PTR,&ulDataLen) ) ); | ||
| 871 | if ( isSizeOK ) { | ||
| 872 | @@ -315,8 +327,9 @@ | ||
| 873 | } | ||
| 874 | |||
| 875 | // Multi-part decryption | ||
| 876 | - CPPUNIT_ASSERT_EQUAL( (CK_RV)CKR_OK, CRYPTOKI_F_PTR( C_DecryptInit(hSession,pMechanism,hKey) ) ); | ||
| 877 | - { | ||
| 878 | + rv = CRYPTOKI_F_PTR( C_DecryptInit(hSession,pMechanism,hKey) ); | ||
| 879 | + CPPUNIT_ASSERT_EQUAL( (CK_BBOOL) CK_FALSE, (CK_BBOOL) ((rv != CKR_OK) && (oldMechs == CK_FALSE)) ); | ||
| 880 | + if (oldMechs == CK_FALSE) { | ||
| 881 | std::vector<CK_BYTE> vDecryptedData; | ||
| 882 | CK_BYTE dummy; | ||
| 883 | for ( std::vector<CK_BYTE>::iterator i(vEncryptedDataParted.begin()); i<vEncryptedDataParted.end(); i+=partSize.getCurrent()) { | ||
| 884 | @@ -836,44 +849,44 @@ | ||
| 885 | |||
| 886 | // Generate all combinations of session/token keys. | ||
| 887 | rv = generateDesKey(hSessionRW,IN_SESSION,IS_PUBLIC,hKey); | ||
| 888 | - CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 889 | - | ||
| 890 | - encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST-1); | ||
| 891 | - encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1); | ||
| 892 | - encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 893 | - encryptDecrypt(CKM_DES_CBC,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 894 | - encryptDecrypt(CKM_DES_CBC,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 895 | - encryptDecrypt(CKM_DES_ECB,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 896 | - encryptDecrypt(CKM_DES_ECB,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 897 | + if (rv == CKR_OK) { | ||
| 898 | + encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST-1); | ||
| 899 | + encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1); | ||
| 900 | + encryptDecrypt(CKM_DES_CBC_PAD,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 901 | + encryptDecrypt(CKM_DES_CBC,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 902 | + encryptDecrypt(CKM_DES_CBC,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 903 | + encryptDecrypt(CKM_DES_ECB,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 904 | + encryptDecrypt(CKM_DES_ECB,blockSize,hSessionRO,hKey,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 905 | + } | ||
| 906 | |||
| 907 | CK_OBJECT_HANDLE hKey2 = CK_INVALID_HANDLE; | ||
| 908 | |||
| 909 | // Generate all combinations of session/token keys. | ||
| 910 | rv = generateDes2Key(hSessionRW,IN_SESSION,IS_PUBLIC,hKey2); | ||
| 911 | - CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 912 | - | ||
| 913 | - encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST-1); | ||
| 914 | - encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1); | ||
| 915 | - encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 916 | - encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 917 | - encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 918 | - encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 919 | - encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 920 | + if (rv == CKR_OK) { | ||
| 921 | + encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST-1); | ||
| 922 | + encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1); | ||
| 923 | + encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 924 | + encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 925 | + encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 926 | + encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 927 | + encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey2,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 928 | + } | ||
| 929 | #endif | ||
| 930 | |||
| 931 | CK_OBJECT_HANDLE hKey3 = CK_INVALID_HANDLE; | ||
| 932 | |||
| 933 | // Generate all combinations of session/token keys. | ||
| 934 | rv = generateDes3Key(hSessionRW,IN_SESSION,IS_PUBLIC,hKey3); | ||
| 935 | - CPPUNIT_ASSERT(rv == CKR_OK); | ||
| 936 | - | ||
| 937 | - encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST-1); | ||
| 938 | - encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1); | ||
| 939 | - encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 940 | - encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 941 | - encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 942 | - encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 943 | - encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 944 | + if (rv == CKR_OK) { | ||
| 945 | + encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST-1); | ||
| 946 | + encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1); | ||
| 947 | + encryptDecrypt(CKM_DES3_CBC_PAD,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 948 | + encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 949 | + encryptDecrypt(CKM_DES3_CBC,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 950 | + encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST); | ||
| 951 | + encryptDecrypt(CKM_DES3_ECB,blockSize,hSessionRO,hKey3,blockSize*NR_OF_BLOCKS_IN_TEST+1, false); | ||
| 952 | + } | ||
| 953 | } | ||
| 954 | |||
| 955 | void SymmetricAlgorithmTests::testNullTemplate() | ||
| 956 | Index: softhsm2-2.6.1/src/lib/test/InfoTests.h | ||
| 957 | =================================================================== | ||
| 958 | --- softhsm2-2.6.1.orig/src/lib/test/InfoTests.h | ||
| 959 | +++ softhsm2-2.6.1/src/lib/test/InfoTests.h | ||
| 960 | @@ -42,13 +42,13 @@ | ||
| 961 | CPPUNIT_TEST_SUITE(InfoTests); | ||
| 962 | CPPUNIT_TEST(testGetInfo); | ||
| 963 | CPPUNIT_TEST(testGetFunctionList); | ||
| 964 | - CPPUNIT_TEST(testGetSlotList); | ||
| 965 | - CPPUNIT_TEST(testGetSlotInfo); | ||
| 966 | - CPPUNIT_TEST(testGetTokenInfo); | ||
| 967 | - CPPUNIT_TEST(testGetMechanismList); | ||
| 968 | - CPPUNIT_TEST(testGetMechanismInfo); | ||
| 969 | - CPPUNIT_TEST(testGetSlotInfoAlt); | ||
| 970 | - CPPUNIT_TEST(testGetMechanismListConfig); | ||
| 971 | + //CPPUNIT_TEST(testGetSlotList); | ||
| 972 | + //CPPUNIT_TEST(testGetSlotInfo); | ||
| 973 | + //CPPUNIT_TEST(testGetTokenInfo); | ||
| 974 | + //CPPUNIT_TEST(testGetMechanismList); | ||
| 975 | + //CPPUNIT_TEST(testGetMechanismInfo); | ||
| 976 | + //CPPUNIT_TEST(testGetSlotInfoAlt); | ||
| 977 | + //CPPUNIT_TEST(testGetMechanismListConfig); | ||
| 978 | CPPUNIT_TEST(testWaitForSlotEvent); | ||
| 979 | CPPUNIT_TEST_SUITE_END(); | ||
| 980 | |||
| 981 | Index: softhsm2-2.6.1/src/lib/test/ObjectTests.h | ||
| 982 | =================================================================== | ||
| 983 | --- softhsm2-2.6.1.orig/src/lib/test/ObjectTests.h | ||
| 984 | +++ softhsm2-2.6.1/src/lib/test/ObjectTests.h | ||
| 985 | @@ -41,7 +41,7 @@ | ||
| 986 | class ObjectTests : public TestsBase | ||
| 987 | { | ||
| 988 | CPPUNIT_TEST_SUITE(ObjectTests); | ||
| 989 | - CPPUNIT_TEST(testCreateObject); | ||
| 990 | + /*CPPUNIT_TEST(testCreateObject); | ||
| 991 | CPPUNIT_TEST(testCopyObject); | ||
| 992 | CPPUNIT_TEST(testDestroyObject); | ||
| 993 | CPPUNIT_TEST(testGetObjectSize); | ||
| 994 | @@ -60,7 +60,7 @@ | ||
| 995 | CPPUNIT_TEST(testAllowedMechanisms); | ||
| 996 | CPPUNIT_TEST(testReAuthentication); | ||
| 997 | CPPUNIT_TEST(testTemplateAttribute); | ||
| 998 | - CPPUNIT_TEST(testCreateSecretKey); | ||
| 999 | + CPPUNIT_TEST(testCreateSecretKey);*/ | ||
| 1000 | CPPUNIT_TEST_SUITE_END(); | ||
| 1001 | |||
| 1002 | public: | ||
| 1003 | Index: softhsm2-2.6.1/src/lib/test/UserTests.h | ||
| 1004 | =================================================================== | ||
| 1005 | --- softhsm2-2.6.1.orig/src/lib/test/UserTests.h | ||
| 1006 | +++ softhsm2-2.6.1/src/lib/test/UserTests.h | ||
| 1007 | @@ -39,10 +39,10 @@ | ||
| 1008 | class UserTests : public TestsNoPINInitBase | ||
| 1009 | { | ||
| 1010 | CPPUNIT_TEST_SUITE(UserTests); | ||
| 1011 | - CPPUNIT_TEST(testInitPIN); | ||
| 1012 | + /*CPPUNIT_TEST(testInitPIN); | ||
| 1013 | CPPUNIT_TEST(testLogin); | ||
| 1014 | CPPUNIT_TEST(testLogout); | ||
| 1015 | - CPPUNIT_TEST(testSetPIN); | ||
| 1016 | + CPPUNIT_TEST(testSetPIN);*/ | ||
| 1017 | CPPUNIT_TEST_SUITE_END(); | ||
| 1018 | |||
| 1019 | public: | ||
| 1020 | Index: softhsm2-2.6.1/src/lib/test/SignVerifyTests.h | ||
| 1021 | =================================================================== | ||
| 1022 | --- softhsm2-2.6.1.orig/src/lib/test/SignVerifyTests.h | ||
| 1023 | +++ softhsm2-2.6.1/src/lib/test/SignVerifyTests.h | ||
| 1024 | @@ -41,14 +41,14 @@ | ||
| 1025 | class SignVerifyTests : public TestsBase | ||
| 1026 | { | ||
| 1027 | CPPUNIT_TEST_SUITE(SignVerifyTests); | ||
| 1028 | - CPPUNIT_TEST(testRsaSignVerify); | ||
| 1029 | + /*CPPUNIT_TEST(testRsaSignVerify); | ||
| 1030 | #ifdef WITH_ECC | ||
| 1031 | CPPUNIT_TEST(testEcSignVerify); | ||
| 1032 | #endif | ||
| 1033 | #ifdef WITH_EDDSA | ||
| 1034 | CPPUNIT_TEST_PARAMETERIZED(testEdSignVerify, {"Ed25519", "Ed448"}); | ||
| 1035 | #endif | ||
| 1036 | - CPPUNIT_TEST(testMacSignVerify); | ||
| 1037 | + CPPUNIT_TEST(testMacSignVerify);*/ | ||
| 1038 | CPPUNIT_TEST_SUITE_END(); | ||
| 1039 | |||
| 1040 | public: | ||
| 1041 | Index: softhsm2-2.6.1/src/lib/test/SymmetricAlgorithmTests.h | ||
| 1042 | =================================================================== | ||
| 1043 | --- softhsm2-2.6.1.orig/src/lib/test/SymmetricAlgorithmTests.h | ||
| 1044 | +++ softhsm2-2.6.1/src/lib/test/SymmetricAlgorithmTests.h | ||
| 1045 | @@ -39,7 +39,7 @@ | ||
| 1046 | class SymmetricAlgorithmTests : public TestsBase | ||
| 1047 | { | ||
| 1048 | CPPUNIT_TEST_SUITE(SymmetricAlgorithmTests); | ||
| 1049 | - CPPUNIT_TEST(testAesEncryptDecrypt); | ||
| 1050 | + /*CPPUNIT_TEST(testAesEncryptDecrypt); | ||
| 1051 | CPPUNIT_TEST(testDesEncryptDecrypt); | ||
| 1052 | #ifdef HAVE_AES_KEY_WRAP | ||
| 1053 | CPPUNIT_TEST(testAesWrapUnwrap); | ||
| 1054 | @@ -49,7 +49,7 @@ | ||
| 1055 | CPPUNIT_TEST(testCheckValue); | ||
| 1056 | CPPUNIT_TEST(testAesCtrOverflow); | ||
| 1057 | CPPUNIT_TEST(testGenericKey); | ||
| 1058 | - CPPUNIT_TEST(testEncDecFinalNULLValidation); | ||
| 1059 | + CPPUNIT_TEST(testEncDecFinalNULLValidation);*/ | ||
| 1060 | CPPUNIT_TEST_SUITE_END(); | ||
| 1061 | |||
| 1062 | public: | ||
| 1063 | Index: softhsm2-2.6.1/src/lib/test/RandomTests.h | ||
| 1064 | =================================================================== | ||
| 1065 | --- softhsm2-2.6.1.orig/src/lib/test/RandomTests.h | ||
| 1066 | +++ softhsm2-2.6.1/src/lib/test/RandomTests.h | ||
| 1067 | @@ -39,8 +39,8 @@ | ||
| 1068 | class RandomTests : public TestsNoPINInitBase | ||
| 1069 | { | ||
| 1070 | CPPUNIT_TEST_SUITE(RandomTests); | ||
| 1071 | - CPPUNIT_TEST(testSeedRandom); | ||
| 1072 | - CPPUNIT_TEST(testGenerateRandom); | ||
| 1073 | + //CPPUNIT_TEST(testSeedRandom); | ||
| 1074 | + //CPPUNIT_TEST(testGenerateRandom); | ||
| 1075 | CPPUNIT_TEST_SUITE_END(); | ||
| 1076 | |||
| 1077 | public: | ||
| 1078 | Index: softhsm2-2.6.1/src/lib/test/SessionTests.h | ||
| 1079 | =================================================================== | ||
| 1080 | --- softhsm2-2.6.1.orig/src/lib/test/SessionTests.h | ||
| 1081 | +++ softhsm2-2.6.1/src/lib/test/SessionTests.h | ||
| 1082 | @@ -40,10 +40,10 @@ | ||
| 1083 | class SessionTests : public TestsNoPINInitBase | ||
| 1084 | { | ||
| 1085 | CPPUNIT_TEST_SUITE(SessionTests); | ||
| 1086 | - CPPUNIT_TEST(testOpenSession); | ||
| 1087 | + /*CPPUNIT_TEST(testOpenSession); | ||
| 1088 | CPPUNIT_TEST(testCloseSession); | ||
| 1089 | CPPUNIT_TEST(testCloseAllSessions); | ||
| 1090 | - CPPUNIT_TEST(testGetSessionInfo); | ||
| 1091 | + CPPUNIT_TEST(testGetSessionInfo);*/ | ||
| 1092 | CPPUNIT_TEST_SUITE_END(); | ||
| 1093 | |||
| 1094 | public: | ||
| 1095 | Index: softhsm2-2.6.1/src/lib/test/TokenTests.h | ||
| 1096 | =================================================================== | ||
| 1097 | --- softhsm2-2.6.1.orig/src/lib/test/TokenTests.h | ||
| 1098 | +++ softhsm2-2.6.1/src/lib/test/TokenTests.h | ||
| 1099 | @@ -39,7 +39,7 @@ | ||
| 1100 | class TokenTests : public TestsNoPINInitBase | ||
| 1101 | { | ||
| 1102 | CPPUNIT_TEST_SUITE(TokenTests); | ||
| 1103 | - CPPUNIT_TEST(testInitToken); | ||
| 1104 | + //CPPUNIT_TEST(testInitToken); | ||
| 1105 | CPPUNIT_TEST_SUITE_END(); | ||
| 1106 | |||
| 1107 | public: | ||
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm index 8dc5c4b18d9..5aa7d80034f 100644 --- a/gnu/packages/security-token.scm +++ b/gnu/packages/security-token.scm | |||
| @@ -223,16 +223,16 @@ the low-level development kit for the Yubico YubiKey authentication device.") | |||
| 223 | (define-public softhsm | 223 | (define-public softhsm |
| 224 | (package | 224 | (package |
| 225 | (name "softhsm") | 225 | (name "softhsm") |
| 226 | (version "2.6.1") | 226 | (version "2.7.0") |
| 227 | (source (origin | 227 | (source (origin |
| 228 | (method url-fetch) | 228 | (method git-fetch) |
| 229 | (uri (string-append | 229 | (uri (git-reference |
| 230 | "https://dist.opendnssec.org/source/" | 230 | (url "https://github.com/softhsm/SoftHSMv2.git") |
| 231 | "softhsm-" version ".tar.gz")) | 231 | (commit version))) |
| 232 | (file-name (git-file-name name version)) | ||
| 232 | (sha256 | 233 | (sha256 |
| 233 | (base32 | 234 | (base32 |
| 234 | "1wkmyi6n3z2pak1cj5yk6v6bv9w0m24skycya48iikab0mrr8931")) | 235 | "0km7pnwp1ny7k317srpagwp3mnb5f5b1d82fj07hqgcmc209s2l3")))) |
| 235 | (patches (search-patches "softhsm-fix-openssl3-tests.patch")))) | ||
| 236 | (build-system gnu-build-system) | 236 | (build-system gnu-build-system) |
| 237 | (arguments | 237 | (arguments |
| 238 | (list #:configure-flags | 238 | (list #:configure-flags |
| @@ -240,7 +240,12 @@ the low-level development kit for the Yubico YubiKey authentication device.") | |||
| 240 | (string-append "--with-p11-kit=" | 240 | (string-append "--with-p11-kit=" |
| 241 | #$output "/share/p11-kit/modules")))) | 241 | #$output "/share/p11-kit/modules")))) |
| 242 | (inputs (list openssl)) | 242 | (inputs (list openssl)) |
| 243 | (native-inputs (list pkg-config cppunit)) | 243 | (native-inputs |
| 244 | (list autoconf | ||
| 245 | automake | ||
| 246 | cppunit | ||
| 247 | libtool | ||
| 248 | pkg-config)) | ||
| 244 | (synopsis "Software implementation of a generic cryptographic device") | 249 | (synopsis "Software implementation of a generic cryptographic device") |
| 245 | (description | 250 | (description |
| 246 | "SoftHSM 2 is a software implementation of a generic cryptographic device | 251 | "SoftHSM 2 is a software implementation of a generic cryptographic device |
