[pkg-opensc-commit] [pkcs11-helper] 45/253: New pkcs11.h revision
Eric Dorland
eric at moszumanska.debian.org
Fri Jan 6 23:39:03 UTC 2017
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository pkcs11-helper.
commit 3469a13d9e4ca68dfa61b36124cf51a32d60c8ba
Author: Alon Bar-Lev <alon.barlev at gmail.com>
Date: Mon Dec 18 19:50:47 2006 +0000
New pkcs11.h revision
---
include/pkcs11-helper-1.0/pkcs11.h | 41 +++++++++++++++++++++++---------------
1 file changed, 25 insertions(+), 16 deletions(-)
diff --git a/include/pkcs11-helper-1.0/pkcs11.h b/include/pkcs11-helper-1.0/pkcs11.h
index 7b78b94..115c309 100644
--- a/include/pkcs11-helper-1.0/pkcs11.h
+++ b/include/pkcs11-helper-1.0/pkcs11.h
@@ -16,10 +16,18 @@
they can be picked up by other projects from there as well. */
/* This file is a modified implementation of the PKCS #11 standard by
- RSA Security Inc. The goal is ABI compatibility to the PKCS #11
- standard on the one hand and conformance to the GNU coding standard
- in the API on the other hand. For this, the following changes are
- made to the specification:
+ RSA Security Inc. It is mostly a drop-in replacement, with the
+ following change:
+
+ This header file does not require any macro definitions by the user
+ (like CK_DEFINE_FUNCTION etc). In fact, it defines those macros
+ for you (if useful, some are missing, let me know if you need
+ more).
+
+ There is an additional API available that does comply better to the
+ GNU coding standard. It can be switched on by defining
+ CRYPTOKI_GNU before including this header file. For this, the
+ following changes are made to the specification:
All structure types are changed to a "struct ck_foo" where CK_FOO
is the type name in PKCS #11.
@@ -35,10 +43,8 @@
Note that function names are still in the original case, as they
need for ABI compatibility.
- CK_FALSE, CK_TRUE and NULL_PTR are removed without substitute.
-
- This header file does not require any macro definitions by the
- user.
+ CK_FALSE, CK_TRUE and NULL_PTR are removed without substitute. Use
+ <stdbool.h>.
If CRYPTOKI_COMPAT is defined before including this header file,
then none of the API changes above take place, and the API is the
@@ -47,7 +53,7 @@
#ifndef PKCS11_H
#define PKCS11_H 1
-#ifdef __cplusplus
+#if defined(__cplusplus)
extern "C" {
#endif
@@ -59,12 +65,16 @@ extern "C" {
versions). */
#define CRYPTOKI_VERSION_MAJOR 2
#define CRYPTOKI_VERSION_MINOR 20
-#define CRYPTOKI_VERSION_REVISION 4
+#define CRYPTOKI_VERSION_REVISION 6
+/* Compatibility interface is default, unless CRYPTOKI_GNU is
+ given. */
+#ifndef CRYPTOKI_GNU
#ifndef CRYPTOKI_COMPAT
#define CRYPTOKI_COMPAT 1
#endif
+#endif
/* System dependencies. */
@@ -86,7 +96,7 @@ extern "C" {
#endif
-#if CRYPTOKI_COMPAT
+#ifdef CRYPTOKI_COMPAT
/* If we are in compatibility mode, switch all exposed names to the
PKCS #11 variant. There are corresponding #undefs below. */
@@ -169,7 +179,7 @@ extern "C" {
#define unlock_mutex UnlockMutex
#define reserved pReserved
-#endif
+#endif /* CRYPTOKI_COMPAT */
@@ -308,7 +318,7 @@ typedef unsigned long ck_object_class_t;
#define CKO_HW_FEATURE (5)
#define CKO_DOMAIN_PARAMETERS (6)
#define CKO_MECHANISM (7)
-#define CKO_VENDOR_DEFINED (unsigned long) (1 << 31))
+#define CKO_VENDOR_DEFINED ((unsigned long) (1 << 31))
typedef unsigned long ck_hw_feature_type_t;
@@ -1160,7 +1170,7 @@ struct ck_c_initialize_args
/* Compatibility layer. */
-#if CRYPTOKI_COMPAT
+#ifdef CRYPTOKI_COMPAT
#undef CK_DEFINE_FUNCTION
#define CK_DEFINE_FUNCTION(retval, name) retval CK_SPEC name
@@ -1325,9 +1335,8 @@ typedef struct ck_c_initialize_args *CK_C_INITIALIZE_ARGS_PTR;
#pragma pack(pop, cryptoki)
#endif
-#ifdef __cplusplus
+#if defined(__cplusplus)
}
#endif
#endif /* PKCS11_H */
-
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/pkcs11-helper.git
More information about the pkg-opensc-commit
mailing list