]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
pkcs11: increase the maximum PIN length from 31 to 255
authorDaiki Ueno <ueno@gnu.org>
Thu, 12 Nov 2020 06:46:19 +0000 (07:46 +0100)
committerDaiki Ueno <ueno@gnu.org>
Fri, 13 Nov 2020 05:27:55 +0000 (06:27 +0100)
The maximum is chosen from the default configuration of SoftHSMv2:
  https://github.com/opendnssec/SoftHSMv2/blob/develop/CMakeLists.txt#L61

Signed-off-by: Daiki Ueno <ueno@gnu.org>
lib/includes/gnutls/pkcs11.h
tests/testpkcs11.sh

index 351ddd1cd8b6314ac5bb5a914f7e3e3111977a79..2436069849fe868403fc83340a2cccd7ef62ca10 100644 (file)
@@ -34,7 +34,7 @@ extern "C" {
 #endif
 /* *INDENT-ON* */
 
-#define GNUTLS_PKCS11_MAX_PIN_LEN 32
+#define GNUTLS_PKCS11_MAX_PIN_LEN 256
 
 /**
  * gnutls_pkcs11_token_callback_t:
index ccdcfbf5ced455d1195747dd781a7486db65d425..38b9585bc002ac9d32003ec7127153f9950ad1b1 100755 (executable)
@@ -931,8 +931,15 @@ reset_pins () {
        UPIN="$2"
        SOPIN="$3"
        NEWPIN=88654321
-       LARGE_NEWPIN="1234123412341234123412341234123" #31 chars
-       TOO_LARGE_NEWPIN="12341234123412341234123412341234" #32 chars
+       # 255 chars
+       LARGE_NEWPIN="\
+1234123412341234123412341234123412341234123412341234123412341234\
+1234123412341234123412341234123412341234123412341234123412341234\
+1234123412341234123412341234123412341234123412341234123412341234\
+123412341234123412341234123412341234123412341234123412341234123\
+"
+       # 256 chars
+       TOO_LARGE_NEWPIN="$LARGE_NEWPIN"4
 
        echo -n "* Setting SO PIN... "
        # Test admin PIN