Commit 699f790c authored by Evan Hunt's avatar Evan Hunt

[master] update pkcs11 headers

4353.	[cleanup]	Update PKCS#11 header files. [RT #42175]
parent 66074f15
4353. [cleanup] Update PKCS#11 header files. [RT #42175]
4352. [cleanup] The ISC DNSSEC Lookaside Validation (DLV) service
is scheduled to be disabled in 2017. A warning is
now logged when named is configured to use it,
......
......@@ -56,6 +56,7 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
......@@ -65,16 +66,23 @@
#endif
#ifndef HAVE_CLOCK_GETTIME
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
int
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
struct timeval tv;
int result;
UNUSED(id);
result = gettimeofday(&tv, NULL);
if (result)
return (result);
......
......@@ -54,6 +54,7 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
......@@ -63,16 +64,23 @@
#endif
#ifndef HAVE_CLOCK_GETTIME
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
int
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
struct timeval tv;
int result;
UNUSED(id);
result = gettimeofday(&tv, NULL);
if (result)
return (result);
......
......@@ -56,6 +56,7 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
......@@ -65,16 +66,23 @@
#endif
#ifndef HAVE_CLOCK_GETTIME
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
int
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
struct timeval tv;
int result;
UNUSED(id);
result = gettimeofday(&tv, NULL);
if (result)
return (result);
......
......@@ -56,6 +56,7 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <pk11/pk11.h>
#include <pk11/internal.h>
......@@ -65,16 +66,23 @@
#endif
#ifndef HAVE_CLOCK_GETTIME
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
int
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
struct timeval tv;
int result;
UNUSED(id);
result = gettimeofday(&tv, NULL);
if (result)
return (result);
......
......@@ -56,6 +56,7 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
......@@ -65,16 +66,23 @@
#endif
#ifndef HAVE_CLOCK_GETTIME
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
int
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
struct timeval tv;
int result;
UNUSED(id);
result = gettimeofday(&tv, NULL);
if (result)
return (result);
......
......@@ -56,6 +56,7 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
......@@ -65,16 +66,23 @@
#endif
#ifndef HAVE_CLOCK_GETTIME
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
int
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
struct timeval tv;
int result;
UNUSED(id);
result = gettimeofday(&tv, NULL);
if (result)
return (result);
......
......@@ -56,21 +56,29 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
#ifndef HAVE_CLOCK_GETTIME
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
int
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
struct timeval tv;
int result;
UNUSED(id);
result = gettimeofday(&tv, NULL);
if (result)
return (result);
......
......@@ -56,21 +56,29 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <pk11/pk11.h>
#include <pk11/internal.h>
#ifndef HAVE_CLOCK_GETTIME
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
int
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
struct timeval tv;
int result;
UNUSED(id);
result = gettimeofday(&tv, NULL);
if (result)
return (result);
......
......@@ -56,21 +56,29 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
#ifndef HAVE_CLOCK_GETTIME
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
int
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
struct timeval tv;
int result;
UNUSED(id);
result = gettimeofday(&tv, NULL);
if (result)
return (result);
......
......@@ -56,6 +56,7 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
......@@ -65,16 +66,23 @@
#endif
#ifndef HAVE_CLOCK_GETTIME
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
int
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
struct timeval tv;
int result;
UNUSED(id);
result = gettimeofday(&tv, NULL);
if (result)
return (result);
......
......@@ -56,6 +56,7 @@
#include <isc/print.h>
#include <isc/result.h>
#include <isc/types.h>
#include <isc/util.h>
#include <pk11/pk11.h>
#include <pk11/result.h>
......@@ -65,16 +66,23 @@
#endif
#ifndef HAVE_CLOCK_GETTIME
#include <sys/time.h>
#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif
int
static int clock_gettime(int32_t id, struct timespec *tp);
static int
clock_gettime(int32_t id, struct timespec *tp)
{
struct timeval tv;
int result;
UNUSED(id);
result = gettimeofday(&tv, NULL);
if (result)
return (result);
......
/*
* Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
......@@ -21,6 +21,7 @@
#include <ctype.h>
#include <isc/mem.h>
#include <isc/safe.h>
#include <isc/string.h>
#include <isc/util.h>
......
/*
* Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
......@@ -22,6 +22,7 @@
#include <isc/entropy.h>
#include <isc/mem.h>
#include <isc/safe.h>
#include <isc/sha1.h>
#include <isc/util.h>
......
/*
* Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
......@@ -20,6 +20,7 @@
#include <isc/entropy.h>
#include <isc/mem.h>
#include <isc/safe.h>
#include <isc/sha2.h>
#include <isc/string.h>
#include <isc/util.h>
......
/*
* Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
......@@ -20,6 +20,7 @@
#include <isc/entropy.h>
#include <isc/mem.h>
#include <isc/safe.h>
#include <isc/sha2.h>
#include <isc/string.h>
#include <isc/util.h>
......
/*
* Copyright (C) 2014, 2015 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
......@@ -25,6 +25,7 @@
#include <isc/sha1.h>
#include <isc/sha2.h>
#include <isc/mem.h>
#include <isc/safe.h>
#include <isc/string.h>
#include <isc/util.h>
......
/* pkcs11.h include file for PKCS #11. */
/* $Revision: 1.2 $ */
/* License to copy and use this software is granted provided that it is
* identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
* (Cryptoki)" in all material mentioning or referencing this software.
* License is also granted to make and use derivative works provided that
* such works are identified as "derived from the RSA Security Inc. PKCS #11
* Cryptographic Token Interface (Cryptoki)" in all material mentioning or
* referencing the derived work.
* RSA Security Inc. makes no representations concerning either the
* merchantability of this software or the suitability of this software for
* any particular purpose. It is provided "as is" without express or implied
* warranty of any kind.
/*
* PKCS #11 Cryptographic Token Interface Base Specification Version 2.40 Errata 01
* Committee Specification Draft 01 / Public Review Draft 01
* 09 December 2015
* Copyright (c) OASIS Open 2015. All Rights Reserved.
* Source: http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/errata01/csprd01/include/pkcs11-v2.40/
* Latest version of the specification: http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html
* https://www.oasis-open.org/policies-guidelines/ipr
*/
#ifndef _PKCS11_H_
......@@ -24,14 +16,14 @@ extern "C" {
#endif
/* Before including this file (pkcs11.h) (or pkcs11t.h by
* itself), 6 platform-specific macros must be defined. These
* itself), 5 platform-specific macros must be defined. These
* macros are described below, and typical definitions for them
* are also given. Be advised that these definitions can depend
* on both the platform and the compiler used (and possibly also
* on whether a Cryptoki library is linked statically or
* dynamically).
*
* In addition to defining these 6 macros, the packing convention
* In addition to defining these 5 macros, the packing convention
* for Cryptoki structures should be set. The Cryptoki
* convention on packing is that structures should be 1-byte
* aligned.
......@@ -81,39 +73,7 @@ extern "C" {
* #define CK_PTR *
*
*
* 2. CK_DEFINE_FUNCTION(returnType, name): A macro which makes
* an exportable Cryptoki library function definition out of a
* return type and a function name. It should be used in the
* following fashion to define the exposed Cryptoki functions in
* a Cryptoki library:
*
* CK_DEFINE_FUNCTION(CK_RV, C_Initialize)(
* CK_VOID_PTR pReserved
* )
* {
* ...
* }
*
* If you're using Microsoft Developer Studio 5.0 to define a
* function in a Win32 Cryptoki .dll, it might be defined by:
*
* #define CK_DEFINE_FUNCTION(returnType, name) \
* returnType __declspec(dllexport) name
*
* If you're using an earlier version of Microsoft Developer
* Studio to define a function in a Win16 Cryptoki .dll, it
* might be defined by:
*
* #define CK_DEFINE_FUNCTION(returnType, name) \
* returnType __export _far _pascal name
*
* In a UNIX environment, it might be defined by:
*
* #define CK_DEFINE_FUNCTION(returnType, name) \
* returnType name
*
*
* 3. CK_DECLARE_FUNCTION(returnType, name): A macro which makes
* 2. CK_DECLARE_FUNCTION(returnType, name): A macro which makes
* an importable Cryptoki library function declaration out of a
* return type and a function name. It should be used in the
* following fashion:
......@@ -141,7 +101,7 @@ extern "C" {
* returnType name
*
*
* 4. CK_DECLARE_FUNCTION_POINTER(returnType, name): A macro
* 3. CK_DECLARE_FUNCTION_POINTER(returnType, name): A macro
* which makes a Cryptoki API function pointer declaration or
* function pointer type declaration out of a return type and a
* function name. It should be used in the following fashion:
......@@ -178,7 +138,7 @@ extern "C" {
* returnType (* name)
*
*
* 5. CK_CALLBACK_FUNCTION(returnType, name): A macro which makes
* 4. CK_CALLBACK_FUNCTION(returnType, name): A macro which makes
* a function pointer type for an application callback out of
* a return type for the callback and a name for the callback.
* It should be used in the following fashion:
......@@ -210,7 +170,7 @@ extern "C" {
* returnType (* name)
*
*
* 6. NULL_PTR: This macro is the value of a NULL pointer.
* 5. NULL_PTR: This macro is the value of a NULL pointer.
*
* In any ANSI/ISO C environment (and in many others as well),
* this should best be defined by
......@@ -222,7 +182,8 @@ extern "C" {
/* All the various Cryptoki types and #define'd values are in the
* file pkcs11t.h. */
* file pkcs11t.h.
*/
#include "pkcs11t.h"
#define __PASTE(x,y) x##y
......@@ -238,7 +199,8 @@ extern "C" {
extern CK_DECLARE_FUNCTION(CK_RV, name)
/* pkcs11f.h has all the information about the Cryptoki
* function prototypes. */
* function prototypes.
*/
#include "pkcs11f.h"
#undef CK_NEED_ARG_LIST
......@@ -257,7 +219,8 @@ extern "C" {
typedef CK_DECLARE_FUNCTION_POINTER(CK_RV, __PASTE(CK_,name))
/* pkcs11f.h has all the information about the Cryptoki
* function prototypes. */
* function prototypes.
*/
#include "pkcs11f.h"
#undef CK_NEED_ARG_LIST
......@@ -275,14 +238,15 @@ extern "C" {
#define CK_PKCS11_FUNCTION_INFO(name) \
__PASTE(CK_,name) name;
struct CK_FUNCTION_LIST {
CK_VERSION version; /* Cryptoki version */
/* Pile all the function pointers into the CK_FUNCTION_LIST. */
/* pkcs11f.h has all the information about the Cryptoki
* function prototypes. */
* function prototypes.
*/
#include "pkcs11f.h"
};
......@@ -296,4 +260,5 @@ struct CK_FUNCTION_LIST {
}
#endif
#endif
#endif /* _PKCS11_H_ */
/* pkcs11f.h include file for PKCS #11. */
/* $Revision: 1.2 $ */
/* License to copy and use this software is granted provided that it is
* identified as "RSA Security Inc. PKCS #11 Cryptographic Token Interface
* (Cryptoki)" in all material mentioning or referencing this software.
* License is also granted to make and use derivative works provided that
* such works are identified as "derived from the RSA Security Inc. PKCS #11
* Cryptographic Token Interface (Cryptoki)" in all material mentioning or
* referencing the derived work.
* RSA Security Inc. makes no representations concerning either the
* merchantability of this software or the suitability of this software for
* any particular purpose. It is provided "as is" without express or implied
* warranty of any kind.
/*
* PKCS #11 Cryptographic Token Interface Base Specification Version 2.40 Errata 01
* Committee Specification Draft 01 / Public Review Draft 01
* 09 December 2015
* Copyright (c) OASIS Open 2015. All Rights Reserved.
* Source: http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/errata01/csprd01/include/pkcs11-v2.40/
* Latest version of the specification: http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/pkcs11-base-v2.40.html
* https://www.oasis-open.org/policies-guidelines/ipr
*/
/* This header file contains pretty much everything about all the */
/* Cryptoki function prototypes. Because this information is */
/* used for more than just declaring function prototypes, the */
/* order of the functions appearing herein is important, and */
/* should not be altered. */
/* This header file contains pretty much everything about all the
* Cryptoki function prototypes. Because this information is
* used for more than just declaring function prototypes, the
* order of the functions appearing herein is important, and
* should not be altered.
*/
/* General-purpose */
......@@ -30,13 +23,15 @@ CK_PKCS11_FUNCTION_INFO(C_Initialize)
(
CK_VOID_PTR pInitArgs /* if this is not NULL_PTR, it gets
* cast to CK_C_INITIALIZE_ARGS_PTR
* and dereferenced */
* and dereferenced
*/
);
#endif
/* C_Finalize indicates that an application is done with the
* Cryptoki library. */
* Cryptoki library.
*/
CK_PKCS11_FUNCTION_INFO(C_Finalize)
#ifdef CK_NEED_ARG_LIST
(
......@@ -59,7 +54,8 @@ CK_PKCS11_FUNCTION_INFO(C_GetFunctionList)
#ifdef CK_NEED_ARG_LIST
(
CK_FUNCTION_LIST_PTR_PTR ppFunctionList /* receives pointer to
* function list */
* function list
*/
);
#endif
......@@ -71,7 +67,7 @@ CK_PKCS11_FUNCTION_INFO(C_GetFunctionList)
CK_PKCS11_FUNCTION_INFO(C_GetSlotList)
#ifdef CK_NEED_ARG_LIST