Description: remove embedded pkcs11*.h code and use libnss instead
Forwarded: no
Author: Tianon Gravi <tianon@debian.org>

Index: golang-github-miekg-pkcs11/pkcs11.go
===================================================================
--- golang-github-miekg-pkcs11.orig/pkcs11.go
+++ golang-github-miekg-pkcs11/pkcs11.go
@@ -17,10 +17,6 @@ package pkcs11
 #cgo darwin LDFLAGS: -lltdl -L/usr/local/lib/ -I/usr/local/share/libtool
 #cgo LDFLAGS: -lltdl
 #define CK_PTR *
-#define CK_DEFINE_FUNCTION(returnType, name) returnType name
-#define CK_DECLARE_FUNCTION(returnType, name) returnType name
-#define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType (* name)
-#define CK_CALLBACK_FUNCTION(returnType, name) returnType (* name)
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -771,7 +767,7 @@ func (c *Ctx) Destroy() {
 
 /* Initialize initializes the Cryptoki library. */
 func (c *Ctx) Initialize() error {
-	args := &C.CK_C_INITIALIZE_ARGS{nil, nil, nil, nil, C.CKF_OS_LOCKING_OK, nil}
+	args := &C.CK_C_INITIALIZE_ARGS{nil, nil, nil, nil, C.CKF_OS_LOCKING_OK, nil, nil}
 	e := C.Initialize(c.ctx, C.CK_VOID_PTR(args))
 	return toError(e)
 }
Index: golang-github-miekg-pkcs11/types.go
===================================================================
--- golang-github-miekg-pkcs11.orig/types.go
+++ golang-github-miekg-pkcs11/types.go
@@ -5,18 +5,15 @@
 package pkcs11
 
 /*
+#cgo pkg-config: nss
 #define CK_PTR *
 #ifndef NULL_PTR
 #define NULL_PTR 0
 #endif
-#define CK_DEFINE_FUNCTION(returnType, name) returnType name
-#define CK_DECLARE_FUNCTION(returnType, name) returnType name
-#define CK_DECLARE_FUNCTION_POINTER(returnType, name) returnType (* name)
-#define CK_CALLBACK_FUNCTION(returnType, name) returnType (* name)
 
 #include <stdlib.h>
 #include <string.h>
-#include "pkcs11.h"
+#include <pkcs11.h>
 
 CK_ULONG Index(CK_ULONG_PTR array, CK_ULONG i)
 {
