本文整理汇总了C++中NSS_Shutdown函数的典型用法代码示例。如果您正苦于以下问题:C++ NSS_Shutdown函数的具体用法?C++ NSS_Shutdown怎么用?C++ NSS_Shutdown使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NSS_Shutdown函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nssCleanup
void
nssCleanup (void)
{
/* Shutdown NSS and exit NSPR gracefully. */
NSS_Shutdown ();
PR_Cleanup ();
}
示例2: Curl_nss_cleanup
/* Global cleanup */
void Curl_nss_cleanup(void)
{
/* This function isn't required to be threadsafe and this is only done
* as a safety feature.
*/
PR_Lock(nss_initlock);
if(initialized) {
/* Free references to client certificates held in the SSL session cache.
* Omitting this hampers destruction of the security module owning
* the certificates. */
SSL_ClearSessionCache();
if(mod && SECSuccess == SECMOD_UnloadUserModule(mod)) {
SECMOD_DestroyModule(mod);
mod = NULL;
}
#ifdef HAVE_NSS_INITCONTEXT
NSS_ShutdownContext(nss_context);
nss_context = NULL;
#else /* HAVE_NSS_INITCONTEXT */
NSS_Shutdown();
#endif
}
PR_Unlock(nss_initlock);
PR_DestroyLock(nss_initlock);
PR_DestroyLock(nss_crllock);
nss_initlock = NULL;
initialized = 0;
}
示例3: crypto_global_finish
void
crypto_global_finish(void)
{
NSS_Shutdown();
PL_ArenaFinish();
PR_Cleanup();
}
示例4: NSS_Shutdown
void MozillaRenderer::shutdown(void)
{
// Shutdown NSS and NSPR
NSS_Shutdown();
// FIXME: this hangs, waiting on a condition variable
//PR_Cleanup();
}
示例5: lsw_nss_shutdown
void lsw_nss_shutdown(void)
{
NSS_Shutdown();
if (!(flags & LSW_NSS_SKIP_PR_CLEANUP)) {
PR_Cleanup();
}
}
示例6: camel_shutdown
/**
* camel_shutdown:
*
* Since: 2.24
**/
void
camel_shutdown (void)
{
CamelCertDB *certdb;
if (!initialised)
return;
certdb = camel_certdb_get_default ();
if (certdb) {
camel_certdb_save (certdb);
camel_certdb_set_default (NULL);
}
/* These next calls must come last. */
if (nss_initlock != NULL) {
PR_Lock (nss_initlock);
if (nss_initialized)
NSS_Shutdown ();
PR_Unlock (nss_initlock);
}
initialised = FALSE;
}
示例7: qdevice_model_net_destroy
int
qdevice_model_net_destroy(struct qdevice_instance *instance)
{
struct qdevice_net_instance *net_instance;
net_instance = instance->model_data;
qdevice_log(LOG_DEBUG, "Destroying algorithm");
qdevice_net_algorithm_destroy(net_instance);
qdevice_log(LOG_DEBUG, "Destroying qdevice_net_instance");
qdevice_net_instance_destroy(net_instance);
qdevice_log(LOG_DEBUG, "Shutting down NSS");
SSL_ClearSessionCache();
if (NSS_Shutdown() != SECSuccess) {
qdevice_log_nss(LOG_WARNING, "Can't shutdown NSS");
}
if (PR_Cleanup() != PR_SUCCESS) {
qdevice_log_nss(LOG_WARNING, "Can't shutdown NSPR");
}
free(net_instance);
return (0);
}
示例8: release_pkcs11_module
void release_pkcs11_module(pkcs11_handle_t *h)
{
SECStatus rv;
close_pkcs11_session(h);
if (h->is_user_module) {
rv = SECMOD_UnloadUserModule(h->module);
if (rv != SECSuccess) {
DBG1("Unloading UserModule failed: %s", SECU_Strerror(PR_GetError()));
}
}
if (h->module) {
SECMOD_DestroyModule(h->module);
}
memset(h, 0, sizeof(pkcs11_handle_t));
free(h);
/* if we initialized NSS, then we need to shut it down */
if (!app_has_NSS) {
rv = NSS_Shutdown();
if (rv != SECSuccess) {
DBG1("NSS Shutdown Failed: %s", SECU_Strerror(PR_GetError()));
}
}
}
示例9: runCmd
static
int runCmd(mainTestFn fnPointer,
int argc,
char **argv,
char *dbPath)
{
int retStat = 0;
/* Initialize NSPR and NSS. */
PR_Init(PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);
/* if using databases, use NSS_Init and not NSS_NoDB_Init */
if (dbPath && PORT_Strlen(dbPath) != 0) {
if (NSS_Init(dbPath) != SECSuccess)
return SECFailure;
} else {
if (NSS_NoDB_Init(NULL) != 0)
return SECFailure;
}
retStat = fnPointer(argc, argv);
if (NSS_Shutdown() != SECSuccess) {
exit(1);
}
PR_Cleanup();
return retStat;
}
示例10: tls_deinit
void tls_deinit(void *ssl_ctx) {
tls_nss_ref_count--;
if (tls_nss_ref_count == 0) {
if (NSS_Shutdown() != SECSuccess)
wpa_printf(MSG_ERROR, "NSS: NSS_Shutdown() failed");
}
}
示例11: main
/*
* _import_crl <url> <der size>
* the der blob is passed through STDIN from pluto's fork
*/
int main(int argc, char *argv[])
{
char *url, *lenstr;
unsigned char *buf, *tbuf;
size_t len, tlen;
ssize_t rd;
int fin;
if (argc != 3)
exit(-1);
progname = argv[0];
url = argv[1];
lenstr = argv[2];
/* can't be 0 */
if (*lenstr == '0' && strlen(lenstr) == 1)
exit(-1);
while (*lenstr != '\0') {
if (!isalnum(*lenstr++)) {
exit(-1);
}
}
tlen = len = (size_t) atoi(argv[2]);
tbuf = buf = (unsigned char *) malloc(len);
if (tbuf == NULL)
exit(-1);
while (tlen != 0 && (rd = read(STDIN_FILENO, buf, len)) != 0) {
if (rd == -1) {
if (errno == EINTR)
continue;
exit(-1);
}
tlen -= rd;
buf += rd;
}
if ((size_t)(buf - tbuf) != len)
exit(-1);
const struct lsw_conf_options *oco = lsw_init_options();
lsw_nss_buf_t err;
if (!lsw_nss_setup(oco->nssdir, 0, lsw_nss_get_password, err)) {
fprintf(stderr, "%s: %s\n", progname, err);
exit(1);
}
fin = import_crl(url, tbuf, len);
if (tbuf != NULL)
free(tbuf);
NSS_Shutdown();
return fin;
}
示例12: sc_shutdown_nss
gboolean
sc_shutdown_nss (GError **error)
{
NSS_Shutdown ();
sc_debug ("NSS shut down");
return TRUE;
}
示例13: ssl_nss_uninit
static void
ssl_nss_uninit(void)
{
NSS_Shutdown();
PR_Cleanup();
_nss_methods = NULL;
}
示例14: crypto_deinit
void
crypto_deinit (void)
{
if (initialized) {
NSS_Shutdown ();
PR_Cleanup ();
}
}
示例15: main
int
main(int argc, char **argv)
{
char * progName = NULL;
SECStatus secStatus;
PLOptState *optstate;
PLOptStatus status;
/* Call the NSPR initialization routines */
PR_Init( PR_SYSTEM_THREAD, PR_PRIORITY_NORMAL, 1);
progName = PL_strdup(argv[0]);
hostName = NULL;
optstate = PL_CreateOptState(argc, argv, "d:h:i:o:p:t:");
while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK)
{
switch(optstate->option)
{
case 'd' : certDir = PL_strdup(optstate->value); break;
case 'h' : hostName = PL_strdup(optstate->value); break;
case 'i' : infileName = PL_strdup(optstate->value); break;
case 'o' : outfileName = PL_strdup(optstate->value); break;
case 'p' : port = PORT_Atoi(optstate->value); break;
case 't' : trustNewServer_p = PL_strdup(optstate->value); break;
case '?' :
default : Usage(progName);
}
}
if (port == 0 || hostName == NULL || infileName == NULL || outfileName == NULL || certDir == NULL)
Usage(progName);
#if 0 /* no client authentication */
/* Set our password function callback. */
PK11_SetPasswordFunc(myPasswd);
#endif
/* Initialize the NSS libraries. */
secStatus = NSS_InitReadWrite(certDir);
if (secStatus != SECSuccess)
{
/* Try it again, readonly. */
secStatus = NSS_Init(certDir);
if (secStatus != SECSuccess)
exitErr("Error initializing NSS", GENERAL_ERROR);
}
/* All cipher suites except RSA_NULL_MD5 are enabled by Domestic Policy. */
NSS_SetDomesticPolicy();
client_main(port);
NSS_Shutdown();
PR_Cleanup();
return 0;
}