ssl-init.c revision d5cebe7f98e63d4e2822863ef2faa4971e8b3a5d
/* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "ioloop.h"
#include "ssl-init.h"
#ifdef HAVE_SSL
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
static bool generating;
static void generate_parameters_file(const char *fname)
{
const char *temp_fname;
int fd;
(void)unlink(temp_fname);
if (fd == -1) {
i_fatal("Can't create temporary SSL parameters file %s: %m",
}
}
{
if (pid < 0) {
i_error("fork() failed: %m");
return;
}
if (pid == 0) {
/* child */
exit(0);
} else {
/* parent */
generating = TRUE;
}
}
{
generating = FALSE;
}
{
return TRUE;
i_error("lstat() failed for SSL parameters file %s: %m",
return TRUE;
}
}
/* make sure it's new enough and the permissions are correct */
return FALSE;
}
return TRUE;
}
{
struct server_settings *server;
if (generating)
return;
break;
break;
}
}
void ssl_init(void)
{
generating = FALSE;
/* check every 10 mins */
}
void ssl_deinit(void)
{
timeout_remove(&to);
}
#else
void ssl_init(void) {}
void ssl_deinit(void) {}
#endif