]> sourceware.org Git - systemtap.git/blame - nsscommon.h
PR21065: dtrace .d usdt parser: tolerate probe ... (...) : (...); syntax
[systemtap.git] / nsscommon.h
CommitLineData
cc7c72cd
DB
1#ifndef NSS_COMMON_H
2#define NSS_COMMON_H 1
3
aeb9cc10
DB
4/* Used for parameters with default C++ values which are also called from C */
5#if defined(c_plusplus) || defined(__cplusplus)
6#define INIT(v,i) v = (i)
7#else
8#define INIT(v,i) v
9#endif
10
11/* These functions are called from both C and C++. */
12#if defined(c_plusplus) || defined(__cplusplus)
13extern "C" {
14#endif
15
9af478a9 16#include <pk11func.h>
52c2652f
NMA
17#include "config.h"
18#if ENABLE_NLS
3cb0c273
LB
19#include <libintl.h>
20#include <locale.h>
52c2652f 21#endif
3cb0c273
LB
22
23#if ENABLE_NLS
24#define _(string) gettext(string)
25#define _N(string, string_plural, count) \
26 ngettext((string), (string_plural), (count))
27#else
28#define _(string) (string)
29#define _N(string, string_plural, count) \
30 ( (count) == 1 ? (string) : (string_plural) )
31#endif
32#define _F(format, ...) autosprintf(_(format), __VA_ARGS__)
33#define _NF(format, format_plural, count, ...) \
34 autosprintf(_N((format), (format_plural), (count)), __VA_ARGS__)
9af478a9 35
aeb9cc10
DB
36char *nssPasswordCallback (PK11SlotInfo *info __attribute ((unused)),
37 PRBool retry __attribute ((unused)),
38 void *arg __attribute ((unused)));
39
dff24561 40SECStatus nssInit (const char *db_path, INIT (int readWrite, 0), INIT (int issueMessage, 1));
aeb9cc10
DB
41void nssCleanup (const char *db_path);
42
43void nsscommon_error (const char *msg, INIT(int logit, 1));
2035bcd4 44void nssError (void);
d781daa0 45
5ab345f0
DB
46PRInt32 PR_Read_Complete (PRFileDesc *fd, void *buf, PRInt32 requestedBytes);
47
aeb9cc10
DB
48#if defined(c_plusplus) || defined(__cplusplus)
49}
50#endif
51
52#if defined(c_plusplus) || defined(__cplusplus)
53/* These functions are only called from C++ */
54#include <string>
55
56const char *server_cert_nickname ();
57std::string server_cert_db_path ();
aeb9cc10 58std::string local_client_cert_db_path ();
c981acd9 59std::string add_cert_db_prefix (const std::string &db_path);
aeb9cc10
DB
60
61void nsscommon_error (const std::string &msg, int logit = 1);
62
63void start_log (const char *arg);
64bool log_ok ();
65void log (const std::string &msg);
66void end_log ();
67
68int check_cert (const std::string &db_path, const std::string &nss_cert_name, bool use_db_password = false);
69int gen_cert_db (const std::string &db_path, const std::string &extraDnsNames, bool use_password);
70SECStatus add_client_cert (const std::string &inFileName, const std::string &db_path);
71
72void sign_file (
73 const std::string &db_path,
74 const std::string &nss_cert_name,
75 const std::string &inputName,
76 const std::string &outputName
77);
78
79CERTCertList *get_cert_list_from_db (const std::string &cert_nickname);
aeb9cc10 80
b3367f63 81SECStatus
cd1418c7 82read_cert_info_from_file (const std::string &certPath,
b3367f63
DS
83 std::string &fingerprint);
84
aeb9cc10 85#endif // defined(c_plusplus) || defined(__cplusplus)
9af478a9 86
cc7c72cd
DB
87#endif // NSS_COMMON_H
88
d781daa0 89/* vim: set sw=2 ts=8 cino=>4,n-2,{2,^-2,t0,(0,u0,w1,M1 : */
This page took 0.11244 seconds and 5 git commands to generate.