From 0fbd2663e67aae221b8558f7b47ef6b97233ae1f Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Wed, 29 May 2019 15:06:21 +0200 Subject: [PATCH 1/2] Add missing ulIvBits to CK_GCM_PARAMS The PKCS#11 specification text does not document the ulIvBits field. But the header file defining CK_GCM_PARAMS uses it. Since the header file is the normative version we need to add it. See also https://github.com/Pkcs11Interop/Pkcs11Interop/issues/126o and https://lists.oasis-open.org/archives/pkcs11-comment/201602/msg00001.html and https://www.oasis-open.org/committees/document.php?document_id=58032&wg_abbrev=pkcs11 --- src/pkcs11/pkcs11.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pkcs11/pkcs11.h b/src/pkcs11/pkcs11.h index 61bd6dc4..a3d6d8f7 100644 --- a/src/pkcs11/pkcs11.h +++ b/src/pkcs11/pkcs11.h @@ -818,6 +818,7 @@ typedef struct CK_RSA_PKCS_PSS_PARAMS { typedef struct CK_GCM_PARAMS { void * pIv; unsigned long ulIvLen; + unsigned long ulIvBits; void * pAAD; unsigned long ulAADLen; unsigned long ulTagBits; From cc189585c855689d06f39c7ccd168f323018c249 Mon Sep 17 00:00:00 2001 From: Ludovic Rousseau Date: Wed, 29 May 2019 15:09:55 +0200 Subject: [PATCH 2/2] pkcs11-spy: display CK_GCM_PARAMS.ulIvBits field --- src/pkcs11/pkcs11-spy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pkcs11/pkcs11-spy.c b/src/pkcs11/pkcs11-spy.c index 6bc9baaa..fc111692 100644 --- a/src/pkcs11/pkcs11-spy.c +++ b/src/pkcs11/pkcs11-spy.c @@ -791,6 +791,7 @@ C_EncryptInit(CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism, CK_OBJECT (CK_GCM_PARAMS *) pMechanism->pParameter; spy_dump_string_in("pIv[ulIvLen]", param->pIv, param->ulIvLen); + spy_dump_ulong_in("ulIvBits", param->ulIvBits); spy_dump_string_in("pAAD[ulAADLen]", param->pAAD, param->ulAADLen); fprintf(spy_output, "pMechanism->pParameter->ulTagBits=%lu\n", param->ulTagBits);