"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.17.5/lib/dns/dst_pkcs11.h" (4 Sep 2020, 1323 Bytes) of package /linux/misc/dns/bind9/9.17.5/bind-9.17.5.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "dst_pkcs11.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 #ifndef DST_PKCS11_H
   13 #define DST_PKCS11_H 1
   14 
   15 #include <isc/lang.h>
   16 #include <isc/log.h>
   17 #include <isc/result.h>
   18 
   19 ISC_LANG_BEGINDECLS
   20 
   21 isc_result_t
   22 dst__pkcs11_toresult(const char *funcname, const char *file, int line,
   23              isc_result_t fallback, CK_RV rv);
   24 
   25 #define PK11_CALL(func, args, fallback)                                 \
   26     ((void)(((rv = (func)args) == CKR_OK) ||                        \
   27         ((ret = dst__pkcs11_toresult(#func, __FILE__, __LINE__, \
   28                          fallback, rv)),            \
   29          0)))
   30 
   31 #define PK11_RET(func, args, fallback)                                  \
   32     ((void)(((rv = (func)args) == CKR_OK) ||                        \
   33         ((ret = dst__pkcs11_toresult(#func, __FILE__, __LINE__, \
   34                          fallback, rv)),            \
   35          0)));                                                  \
   36     if (rv != CKR_OK)                                               \
   37         goto err;
   38 
   39 ISC_LANG_ENDDECLS
   40 
   41 #endif /* DST_PKCS11_H */