1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
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)
{
|