Commit Graph
4 Commits
Author SHA1 Message Date
Cykesiopka fb6f11c8c3 Bug 1260626 - Add extra slot and token to pkcs11testmodule that is always present. r=keeler
This allow tests to opt out of pkcs11testmodule's current cyclic token
insertions and removals, which is useful for some tests, but an annoyance for
others.

MozReview-Commit-ID: 790uzLZkdtN
2016-11-02 00:08:17 +08:00
Mike Hommey 333794ede1 Bug 1120937 - Properly initialize string fields from the PKCS#11 test module. r=keeler
The string fields need to be padded with spaces, according to what
PK11_MakeString does to find the end of the string.

While here, factor all the string manipulations in the test module and
use some C++ template magic to do the right thing.

This changes the static asserts from (with clang):

pkcs11testmodule.cpp:45:3: error: static_assert failed
      "TestManufacturerID too long - make it shorter"
  static_assert(sizeof(TestManufacturerID) <= sizeof(pInfo->manufacturerID),
  ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

to:

pkcs11testmodule.cpp:46:3: error: static_assert failed
      "DestSize >= SrcSize - 1"
  static_assert(DestSize >= SrcSize - 1, "DestSize >= SrcSize - 1");
  ^             ~~~~~~~~~~~~~~~~~~~~~~~
pkcs11testmodule.cpp:58:3: note: in instantiation of function
      template specialization 'CopyString<32, 63>' requested here
  CopyString(pInfo->manufacturerID, TestManufacturerID);
  ^

which actually gives more information than before: it gives the length of
both buffers.
2015-02-13 10:29:18 +09:00
Mike Hommey 79d7e40ee7 Bug 1120937 - Properly initialize the session field from C_OpenSession in the PKCS#11 test module. r=dkeeler 2015-01-14 15:18:50 +09:00
David Keeler c6d0086bbb bug 1038913 - (4/4) test that smart card events are dispatched by the observer service r=briansmith 2014-08-06 16:56:12 -07:00