1 --- /dev/null 2018-05-15 12:27:28.000000000 +0200
2 +++ opensc-0.19.0/src/tests/p11test/p11test_common.h 2018-09-25 21:02:30.158771398 +0200
5 + * p11test_common.h: Test suite shared declarations for PKCS#11 API
7 + * Copyright (C) 2016 Martin Strhársky <strharsky.martin@gmail.com>
8 + * Copyright (C) 2016, 2017 Red Hat, Inc.
10 + * Author: Jakub Jelen <jjelen@redhat.com>
12 + * This library is free software; you can redistribute it and/or
13 + * modify it under the terms of the GNU Lesser General Public
14 + * License as published by the Free Software Foundation; either
15 + * version 2.1 of the License, or (at your option) any later version.
17 + * This library is distributed in the hope that it will be useful,
18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 + * Lesser General Public License for more details.
22 + * You should have received a copy of the GNU General Public License
23 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 +#ifndef P11TEST_COMMON_H
27 +#define P11TEST_COMMON_H
34 +#include "pkcs11/pkcs11.h"
35 +#include "libopensc/sc-ossl-compat.h"
37 +#define MAX_MECHS 200
40 + #define debug_print(fmt, ...) \
41 + { fprintf(stderr, fmt "\n", ##__VA_ARGS__); } while (0)
43 + #define debug_print(fmt, ...)
46 +#define FLAGS_SIGN 0x01
47 +#define FLAGS_SIGN_OPENSSL 0x02
48 +#define FLAGS_SIGN_ANY ( FLAGS_SIGN | FLAGS_SIGN_OPENSSL )
49 +#define FLAGS_DECRYPT 0x04
50 +#define FLAGS_DECRYPT_OPENSSL 0x08
51 +#define FLAGS_DECRYPT_ANY ( FLAGS_DECRYPT | FLAGS_DECRYPT_OPENSSL )
63 + CK_MECHANISM_TYPE mech;
64 + CK_MECHANISM_TYPE hash;
65 + CK_RSA_PKCS_MGF_TYPE mgf;
72 + CK_FUNCTION_LIST_PTR function_pointer;
74 + CK_SESSION_HANDLE session_handle;
78 + unsigned int interactive;
81 + test_mech_t rsa_mechs[MAX_MECHS];
82 + size_t num_rsa_mechs;
83 + test_mech_t ec_mechs[MAX_MECHS];
84 + size_t num_ec_mechs;
85 + test_mech_t keygen_mechs[MAX_MECHS];
86 + size_t num_keygen_mechs;
91 +#endif /* P11TEST_COMMON_H */