Blame SOURCES/nss-util-3.19.1-tls12-mechanisms.patch

d44611
diff --git a/lib/util/pkcs11t.h b/lib/util/pkcs11t.h
d44611
--- a/lib/util/pkcs11t.h
d44611
+++ b/lib/util/pkcs11t.h
d44611
@@ -819,16 +819,26 @@ typedef CK_ULONG          CK_MECHANISM_T
d44611
 /* WTLS mechanisms are new for v2.20 */
d44611
 #define CKM_WTLS_PRE_MASTER_KEY_GEN         0x000003D0
d44611
 #define CKM_WTLS_MASTER_KEY_DERIVE          0x000003D1
d44611
 #define CKM_WTLS_MASTER_KEY_DERIVE_DH_ECC   0x000003D2
d44611
 #define CKM_WTLS_PRF                        0x000003D3
d44611
 #define CKM_WTLS_SERVER_KEY_AND_MAC_DERIVE  0x000003D4
d44611
 #define CKM_WTLS_CLIENT_KEY_AND_MAC_DERIVE  0x000003D5
d44611
 
d44611
+/* TLS 1.2 mechanisms are new for v2.40 */
d44611
+#define CKM_TLS12_MASTER_KEY_DERIVE         0x000003E0
d44611
+#define CKM_TLS12_KEY_AND_MAC_DERIVE        0x000003E1
d44611
+#define CKM_TLS12_MASTER_KEY_DERIVE_DH      0x000003E2
d44611
+#define CKM_TLS10_MAC_SERVER                0x000003E3
d44611
+#define CKM_TLS10_MAC_CLIENT                0x000003E4
d44611
+#define CKM_TLS12_MAC                       0x000003E5
d44611
+#define CKM_TLS12_KEY_SAFE_DERIVE           0x000003E6
d44611
+#define CKM_TLS_KDF                         0x000003E7
d44611
+
d44611
 #define CKM_KEY_WRAP_LYNKS             0x00000400
d44611
 #define CKM_KEY_WRAP_SET_OAEP          0x00000401
d44611
 
d44611
 /* CKM_CMS_SIG is new for v2.20 */
d44611
 #define CKM_CMS_SIG                    0x00000500
d44611
 
d44611
 /* Fortezza mechanisms */
d44611
 #define CKM_SKIPJACK_KEY_GEN           0x00001000
d44611
@@ -1643,16 +1653,55 @@ typedef struct CK_TLS_PRF_PARAMS {
d44611
   CK_BYTE_PTR  pLabel;
d44611
   CK_ULONG     ulLabelLen;
d44611
   CK_BYTE_PTR  pOutput;
d44611
   CK_ULONG_PTR pulOutputLen;
d44611
 } CK_TLS_PRF_PARAMS;
d44611
 
d44611
 typedef CK_TLS_PRF_PARAMS CK_PTR CK_TLS_PRF_PARAMS_PTR;
d44611
 
d44611
+/* TLS 1.2 is new for version 2.40 */
d44611
+typedef struct CK_TLS12_MASTER_KEY_DERIVE_PARAMS {
d44611
+  CK_SSL3_RANDOM_DATA RandomInfo;
d44611
+  CK_VERSION_PTR pVersion;
d44611
+  CK_MECHANISM_TYPE prfHashMechanism;
d44611
+} CK_TLS12_MASTER_KEY_DERIVE_PARAMS;
d44611
+
d44611
+typedef CK_TLS12_MASTER_KEY_DERIVE_PARAMS CK_PTR \
d44611
+  CK_TLS12_MASTER_KEY_DERIVE_PARAMS_PTR;
d44611
+
d44611
+typedef struct CK_TLS12_KEY_MAT_PARAMS {
d44611
+  CK_ULONG ulMacSizeInBits;
d44611
+  CK_ULONG ulKeySizeInBits;
d44611
+  CK_ULONG ulIVSizeInBits;
d44611
+  CK_BBOOL bIsExport;  /* Unused. Must be set to CK_FALSE. */
d44611
+  CK_SSL3_RANDOM_DATA RandomInfo;
d44611
+  CK_SSL3_KEY_MAT_OUT_PTR pReturnedKeyMaterial;
d44611
+  CK_MECHANISM_TYPE prfHashMechanism;
d44611
+} CK_TLS12_KEY_MAT_PARAMS;
d44611
+
d44611
+typedef CK_TLS12_KEY_MAT_PARAMS CK_PTR CK_TLS12_KEY_MAT_PARAMS_PTR;
d44611
+
d44611
+typedef struct CK_TLS_KDF_PARAMS {
d44611
+  CK_MECHANISM_TYPE prfMechanism;
d44611
+  CK_BYTE_PTR pLabel;
d44611
+  CK_ULONG ulLabelLength;
d44611
+  CK_SSL3_RANDOM_DATA RandomInfo;
d44611
+  CK_BYTE_PTR pContextData;
d44611
+  CK_ULONG ulContextDataLength;
d44611
+} CK_TLS_KDF_PARAMS;
d44611
+
d44611
+typedef struct CK_TLS12_MAC_PARAMS {
d44611
+  CK_MECHANISM_TYPE prfHashMechanism;
d44611
+  CK_ULONG ulMacLength;
d44611
+  CK_ULONG ulServerOrClient;
d44611
+} CK_TLS12_MAC_PARAMS;
d44611
+
d44611
+typedef CK_TLS12_MAC_PARAMS CK_PTR CK_TLS12_MAC_PARAMS_PTR;
d44611
+
d44611
 /* WTLS is new for version 2.20 */
d44611
 typedef struct CK_WTLS_RANDOM_DATA {
d44611
   CK_BYTE_PTR pClientRandom;
d44611
   CK_ULONG    ulClientRandomLen;
d44611
   CK_BYTE_PTR pServerRandom;
d44611
   CK_ULONG    ulServerRandomLen;
d44611
 } CK_WTLS_RANDOM_DATA;
d44611