wolfssl/src/crl.c

667 lines
16 KiB
C
Raw Normal View History

2012-05-11 23:22:16 +04:00
/* crl.c
*
2014-04-12 01:58:58 +04:00
* Copyright (C) 2006-2014 wolfSSL Inc.
2012-05-11 23:22:16 +04:00
*
* This file is part of CyaSSL.
*
* CyaSSL is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* CyaSSL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
2014-04-12 01:58:58 +04:00
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
2012-05-11 23:22:16 +04:00
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <cyassl/ctaocrypt/settings.h>
2012-05-11 23:22:16 +04:00
#ifdef HAVE_CRL
2012-05-17 04:04:56 +04:00
#include <cyassl/internal.h>
2014-03-25 22:39:07 +04:00
#include <cyassl/error-ssl.h>
2012-05-11 23:22:16 +04:00
2012-05-17 04:04:56 +04:00
#include <dirent.h>
#include <sys/stat.h>
2012-05-17 04:04:56 +04:00
#include <string.h>
2012-05-11 23:22:16 +04:00
#ifdef HAVE_CRL_MONITOR
static int StopMonitor(int mfd);
#endif
2012-05-11 23:22:16 +04:00
2012-05-17 04:04:56 +04:00
/* Initialze CRL members */
int InitCRL(CYASSL_CRL* crl, CYASSL_CERT_MANAGER* cm)
{
2012-05-25 07:10:38 +04:00
CYASSL_ENTER("InitCRL");
2012-05-11 23:22:16 +04:00
2012-05-25 07:10:38 +04:00
crl->cm = cm;
crl->crlList = NULL;
2012-05-23 04:25:15 +04:00
crl->monitors[0].path = NULL;
crl->monitors[1].path = NULL;
#ifdef HAVE_CRL_MONITOR
crl->tid = 0;
crl->mfd = -1; /* mfd for bsd is kqueue fd */
2012-05-23 04:25:15 +04:00
#endif
2012-05-25 07:10:38 +04:00
if (InitMutex(&crl->crlLock) != 0)
return BAD_MUTEX_E;
2012-05-11 23:22:16 +04:00
2012-05-25 07:10:38 +04:00
return 0;
2012-05-17 04:04:56 +04:00
}
2012-05-11 23:22:16 +04:00
2012-05-17 04:04:56 +04:00
/* Initialze CRL Entry */
static int InitCRL_Entry(CRL_Entry* crle, DecodedCRL* dcrl)
{
2012-06-05 21:35:30 +04:00
CYASSL_ENTER("InitCRL_Entry");
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
XMEMCPY(crle->issuerHash, dcrl->issuerHash, SHA_DIGEST_SIZE);
/* XMEMCPY(crle->crlHash, dcrl->crlHash, SHA_DIGEST_SIZE);
* copy the hash here if needed for optimized comparisons */
2012-05-25 07:10:38 +04:00
XMEMCPY(crle->lastDate, dcrl->lastDate, MAX_DATE_SIZE);
XMEMCPY(crle->nextDate, dcrl->nextDate, MAX_DATE_SIZE);
2012-05-25 01:07:59 +04:00
crle->lastDateFormat = dcrl->lastDateFormat;
crle->nextDateFormat = dcrl->nextDateFormat;
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
crle->certs = dcrl->certs; /* take ownsership */
dcrl->certs = NULL;
crle->totalCerts = dcrl->totalCerts;
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
return 0;
2012-05-17 04:04:56 +04:00
}
/* Free all CRL Entry resources */
static void FreeCRL_Entry(CRL_Entry* crle)
{
2012-05-25 07:10:38 +04:00
RevokedCert* tmp = crle->certs;
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
CYASSL_ENTER("FreeCRL_Entry");
2012-05-17 04:04:56 +04:00
while(tmp) {
RevokedCert* next = tmp->next;
XFREE(tmp, NULL, DYNAMIC_TYPE_REVOKED);
tmp = next;
}
}
/* Free all CRL resources */
2012-11-27 23:36:36 +04:00
void FreeCRL(CYASSL_CRL* crl, int dynamic)
2012-05-17 04:04:56 +04:00
{
2012-05-25 07:10:38 +04:00
CRL_Entry* tmp = crl->crlList;
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
CYASSL_ENTER("FreeCRL");
2012-05-17 04:04:56 +04:00
2012-05-23 04:25:15 +04:00
if (crl->monitors[0].path)
XFREE(crl->monitors[0].path, NULL, DYNAMIC_TYPE_CRL_MONITOR);
if (crl->monitors[1].path)
XFREE(crl->monitors[1].path, NULL, DYNAMIC_TYPE_CRL_MONITOR);
2012-05-17 04:04:56 +04:00
while(tmp) {
CRL_Entry* next = tmp->next;
FreeCRL_Entry(tmp);
XFREE(tmp, NULL, DYNAMIC_TYPE_CRL_ENTRY);
tmp = next;
}
2012-05-23 04:25:15 +04:00
#ifdef HAVE_CRL_MONITOR
if (crl->tid != 0) {
CYASSL_MSG("stopping monitor thread");
if (StopMonitor(crl->mfd) == 0)
pthread_join(crl->tid, NULL);
else {
CYASSL_MSG("stop monitor failed, cancel instead");
pthread_cancel(crl->tid);
}
2012-05-23 04:25:15 +04:00
}
#endif
2012-05-17 04:04:56 +04:00
FreeMutex(&crl->crlLock);
2012-11-27 23:36:36 +04:00
if (dynamic) /* free self */
XFREE(crl, NULL, DYNAMIC_TYPE_CRL);
2012-05-17 04:04:56 +04:00
}
/* Is the cert ok with CRL, return 0 on success */
int CheckCertCRL(CYASSL_CRL* crl, DecodedCert* cert)
{
2012-05-25 01:07:59 +04:00
CRL_Entry* crle;
int foundEntry = 0;
int ret = 0;
2012-05-17 04:04:56 +04:00
2012-05-25 01:07:59 +04:00
CYASSL_ENTER("CheckCertCRL");
2012-05-17 04:04:56 +04:00
2012-05-25 01:07:59 +04:00
if (LockMutex(&crl->crlLock) != 0) {
CYASSL_MSG("LockMutex failed");
return BAD_MUTEX_E;
2012-05-25 01:07:59 +04:00
}
2012-05-17 04:04:56 +04:00
2012-05-25 01:07:59 +04:00
crle = crl->crlList;
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
while (crle) {
if (XMEMCMP(crle->issuerHash, cert->issuerHash, SHA_DIGEST_SIZE) == 0) {
CYASSL_MSG("Found CRL Entry on list");
2012-05-25 01:07:59 +04:00
CYASSL_MSG("Checking next date validity");
if (!ValidateDate(crle->nextDate, crle->nextDateFormat, AFTER)) {
CYASSL_MSG("CRL next date is no longer valid");
ret = ASN_AFTER_DATE_E;
}
else
foundEntry = 1;
break;
2012-05-25 07:10:38 +04:00
}
2012-05-25 01:07:59 +04:00
crle = crle->next;
2012-05-25 07:10:38 +04:00
}
if (foundEntry) {
RevokedCert* rc = crle->certs;
while (rc) {
if (XMEMCMP(rc->serialNumber, cert->serial, rc->serialSz) == 0) {
CYASSL_MSG("Cert revoked");
ret = CRL_CERT_REVOKED;
break;
2012-05-18 04:44:54 +04:00
}
2012-05-25 07:10:38 +04:00
rc = rc->next;
}
}
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
UnLockMutex(&crl->crlLock);
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
if (foundEntry == 0) {
CYASSL_MSG("Couldn't find CRL for status check");
ret = CRL_MISSING;
if (crl->cm->cbMissingCRL) {
char url[256];
CYASSL_MSG("Issuing missing CRL callback");
url[0] = '\0';
if (cert->extCrlInfoSz < (int)sizeof(url) -1 ) {
XMEMCPY(url, cert->extCrlInfo, cert->extCrlInfoSz);
url[cert->extCrlInfoSz] = '\0';
}
else {
CYASSL_MSG("CRL url too long");
}
crl->cm->cbMissingCRL(url);
}
}
return ret;
2012-05-17 04:04:56 +04:00
}
/* Add Decoded CRL, 0 on success */
static int AddCRL(CYASSL_CRL* crl, DecodedCRL* dcrl)
{
2012-05-25 07:10:38 +04:00
CRL_Entry* crle;
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
CYASSL_ENTER("AddCRL");
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
crle = (CRL_Entry*)XMALLOC(sizeof(CRL_Entry), NULL, DYNAMIC_TYPE_CRL_ENTRY);
if (crle == NULL) {
CYASSL_MSG("alloc CRL Entry failed");
return -1;
}
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
if (InitCRL_Entry(crle, dcrl) < 0) {
CYASSL_MSG("Init CRL Entry failed");
2012-05-19 03:01:21 +04:00
XFREE(crle, NULL, DYNAMIC_TYPE_CRL_ENTRY);
2012-05-25 07:10:38 +04:00
return -1;
}
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
if (LockMutex(&crl->crlLock) != 0) {
CYASSL_MSG("LockMutex failed");
FreeCRL_Entry(crle);
2012-05-19 03:01:21 +04:00
XFREE(crle, NULL, DYNAMIC_TYPE_CRL_ENTRY);
return BAD_MUTEX_E;
2012-05-25 07:10:38 +04:00
}
crle->next = crl->crlList;
crl->crlList = crle;
UnLockMutex(&crl->crlLock);
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
return 0;
2012-05-17 04:04:56 +04:00
}
/* Load CRL File of type, SSL_SUCCESS on ok */
int BufferLoadCRL(CYASSL_CRL* crl, const byte* buff, long sz, int type)
{
2012-05-25 07:10:38 +04:00
int ret = SSL_SUCCESS;
const byte* myBuffer = buff; /* if DER ok, otherwise switch */
buffer der;
DecodedCRL dcrl;
der.buffer = NULL;
CYASSL_ENTER("BufferLoadCRL");
if (crl == NULL || buff == NULL || sz == 0)
return BAD_FUNC_ARG;
if (type == SSL_FILETYPE_PEM) {
int eccKey = 0; /* not used */
EncryptedInfo info;
info.ctx = NULL;
ret = PemToDer(buff, sz, CRL_TYPE, &der, NULL, &info, &eccKey);
if (ret == 0) {
myBuffer = der.buffer;
sz = der.length;
2012-05-18 04:44:54 +04:00
}
2012-05-25 07:10:38 +04:00
else {
CYASSL_MSG("Pem to Der failed");
return -1;
}
}
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
InitDecodedCRL(&dcrl);
2012-11-02 01:14:40 +04:00
ret = ParseCRL(&dcrl, myBuffer, (word32)sz, crl->cm);
2012-05-25 07:10:38 +04:00
if (ret != 0) {
CYASSL_MSG("ParseCRL error");
}
else {
ret = AddCRL(crl, &dcrl);
if (ret != 0) {
CYASSL_MSG("AddCRL error");
}
}
FreeDecodedCRL(&dcrl);
2012-05-17 04:04:56 +04:00
2012-05-25 07:10:38 +04:00
if (der.buffer)
XFREE(der.buffer, NULL, DYNAMIC_TYPE_CRL);
if (ret == 0)
return SSL_SUCCESS; /* convert */
return ret;
2012-05-17 04:04:56 +04:00
}
2012-05-23 04:25:15 +04:00
#ifdef HAVE_CRL_MONITOR
/* read in new CRL entries and save new list */
static int SwapLists(CYASSL_CRL* crl)
{
int ret;
CYASSL_CRL tmp;
CRL_Entry* newList;
if (InitCRL(&tmp, crl->cm) < 0) {
CYASSL_MSG("Init tmp CRL failed");
return -1;
}
if (crl->monitors[0].path) {
ret = LoadCRL(&tmp, crl->monitors[0].path, SSL_FILETYPE_PEM, 0);
if (ret != SSL_SUCCESS) {
CYASSL_MSG("PEM LoadCRL on dir change failed");
2012-11-27 23:36:36 +04:00
FreeCRL(&tmp, 0);
2012-05-23 04:25:15 +04:00
return -1;
}
}
if (crl->monitors[1].path) {
ret = LoadCRL(&tmp, crl->monitors[1].path, SSL_FILETYPE_ASN1, 0);
if (ret != SSL_SUCCESS) {
CYASSL_MSG("DER LoadCRL on dir change failed");
2012-11-27 23:36:36 +04:00
FreeCRL(&tmp, 0);
2012-05-23 04:25:15 +04:00
return -1;
}
}
if (LockMutex(&crl->crlLock) != 0) {
CYASSL_MSG("LockMutex failed");
2012-11-27 23:36:36 +04:00
FreeCRL(&tmp, 0);
2012-05-23 04:25:15 +04:00
return -1;
}
newList = tmp.crlList;
/* swap lists */
tmp.crlList = crl->crlList;
crl->crlList = newList;
UnLockMutex(&crl->crlLock);
2012-11-27 23:36:36 +04:00
FreeCRL(&tmp, 0);
2012-05-23 04:25:15 +04:00
return 0;
}
2012-11-17 01:25:45 +04:00
#if (defined(__MACH__) || defined(__FreeBSD__))
2012-05-23 04:25:15 +04:00
2012-11-17 01:25:45 +04:00
#include <sys/types.h>
2012-05-23 04:25:15 +04:00
#include <sys/event.h>
#include <sys/time.h>
#include <fcntl.h>
#include <unistd.h>
2012-05-23 04:25:15 +04:00
2012-11-17 01:25:45 +04:00
#ifdef __MACH__
#define XEVENT_MODE O_EVTONLY
#elif defined(__FreeBSD__)
#define XEVENT_MODE EVFILT_VNODE
#endif
/* we need a unique kqueue user filter fd for crl in case user is doing custom
* events too */
#ifndef CRL_CUSTOM_FD
#define CRL_CUSTOM_FD 123456
#endif
/* shutdown monitor thread, 0 on success */
static int StopMonitor(int mfd)
{
struct kevent change;
/* trigger custom shutdown */
EV_SET(&change, CRL_CUSTOM_FD, EVFILT_USER, 0, NOTE_TRIGGER, 0, NULL);
if (kevent(mfd, &change, 1, NULL, 0, NULL) < 0) {
CYASSL_MSG("kevent trigger customer event failed");
return -1;
}
return 0;
}
2012-05-23 04:25:15 +04:00
/* OS X monitoring */
static void* DoMonitor(void* arg)
{
int fPEM, fDER;
2012-05-23 04:25:15 +04:00
struct kevent change;
CYASSL_CRL* crl = (CYASSL_CRL*)arg;
CYASSL_ENTER("DoMonitor");
crl->mfd = kqueue();
if (crl->mfd == -1) {
2012-05-23 04:25:15 +04:00
CYASSL_MSG("kqueue failed");
return NULL;
}
/* listen for custom shutdown event */
EV_SET(&change, CRL_CUSTOM_FD, EVFILT_USER, EV_ADD, 0, 0, NULL);
if (kevent(crl->mfd, &change, 1, NULL, 0, NULL) < 0) {
CYASSL_MSG("kevent monitor customer event failed");
close(crl->mfd);
return NULL;
}
2012-05-23 04:25:15 +04:00
fPEM = -1;
fDER = -1;
if (crl->monitors[0].path) {
2012-11-17 01:25:45 +04:00
fPEM = open(crl->monitors[0].path, XEVENT_MODE);
2012-05-23 04:25:15 +04:00
if (fPEM == -1) {
CYASSL_MSG("PEM event dir open failed");
close(crl->mfd);
2012-05-23 04:25:15 +04:00
return NULL;
}
}
if (crl->monitors[1].path) {
2012-11-17 01:25:45 +04:00
fDER = open(crl->monitors[1].path, XEVENT_MODE);
2012-05-23 04:25:15 +04:00
if (fDER == -1) {
CYASSL_MSG("DER event dir open failed");
close(crl->mfd);
2012-05-23 04:25:15 +04:00
return NULL;
}
}
if (fPEM != -1)
EV_SET(&change, fPEM, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_ONESHOT,
NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_ATTRIB, 0, 0);
if (fDER != -1)
EV_SET(&change, fDER, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_ONESHOT,
NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_ATTRIB, 0, 0);
for (;;) {
struct kevent event;
int numEvents = kevent(crl->mfd, &change, 1, &event, 1, NULL);
2012-05-23 04:25:15 +04:00
CYASSL_MSG("Got kevent");
if (numEvents == -1) {
CYASSL_MSG("kevent problem, continue");
continue;
}
if (event.filter == EVFILT_USER) {
CYASSL_MSG("Got user shutdown event, breaking out");
break;
}
2012-05-23 04:25:15 +04:00
if (SwapLists(crl) < 0) {
CYASSL_MSG("SwapLists problem, continue");
}
}
if (fPEM != -1)
close(fPEM);
if (fDER != -1)
close(fDER);
close(crl->mfd);
2012-05-23 04:25:15 +04:00
return NULL;
}
#elif defined(__linux__)
2012-05-23 04:25:15 +04:00
#include <sys/types.h>
2012-05-24 03:55:26 +04:00
#include <sys/inotify.h>
#include <unistd.h>
2012-05-23 04:25:15 +04:00
/* shutdown monitor thread, 0 on success */
static int StopMonitor(int mfd)
{
return -1;
}
2012-05-23 04:25:15 +04:00
/* linux monitoring */
static void* DoMonitor(void* arg)
{
int notifyFd;
int wd;
CYASSL_CRL* crl = (CYASSL_CRL*)arg;
CYASSL_ENTER("DoMonitor");
notifyFd = inotify_init();
if (notifyFd < 0) {
CYASSL_MSG("inotify failed");
return NULL;
}
if (crl->monitors[0].path) {
2012-05-24 03:55:26 +04:00
wd = inotify_add_watch(notifyFd, crl->monitors[0].path, IN_CLOSE_WRITE |
2012-05-23 04:25:15 +04:00
IN_DELETE);
if (wd < 0) {
CYASSL_MSG("PEM notify add watch failed");
return NULL;
}
}
if (crl->monitors[1].path) {
2012-05-24 03:55:26 +04:00
wd = inotify_add_watch(notifyFd, crl->monitors[1].path, IN_CLOSE_WRITE |
2012-05-23 04:25:15 +04:00
IN_DELETE);
if (wd < 0) {
CYASSL_MSG("DER notify add watch failed");
return NULL;
}
}
for (;;) {
2012-11-16 22:54:36 +04:00
char buff[8192];
int length = read(notifyFd, buff, sizeof(buff));
2012-05-23 04:25:15 +04:00
CYASSL_MSG("Got notify event");
if (length < 0) {
CYASSL_MSG("notify read problem, continue");
continue;
}
if (SwapLists(crl) < 0) {
CYASSL_MSG("SwapLists problem, continue");
}
}
return NULL;
}
#else
#error "CRL monitor only currently supported on linux or mach"
2012-05-23 04:25:15 +04:00
#endif /* MACH or linux */
/* Start Monitoring the CRL path(s) in a thread */
2012-05-26 00:09:27 +04:00
static int StartMonitorCRL(CYASSL_CRL* crl)
2012-05-23 04:25:15 +04:00
{
pthread_attr_t attr;
CYASSL_ENTER("StartMonitorCRL");
if (crl == NULL)
return BAD_FUNC_ARG;
if (crl->tid != 0) {
CYASSL_MSG("Monitor thread already running");
return MONITOR_RUNNING_E;
}
pthread_attr_init(&attr);
if (pthread_create(&crl->tid, &attr, DoMonitor, crl) != 0) {
CYASSL_MSG("Thread creation error");
return THREAD_CREATE_E;
}
return SSL_SUCCESS;
}
#else /* HAVE_CRL_MONITOR */
2012-05-26 00:09:27 +04:00
static int StartMonitorCRL(CYASSL_CRL* crl)
2012-05-23 04:25:15 +04:00
{
2012-11-02 01:14:40 +04:00
(void)crl;
2012-06-05 22:31:00 +04:00
CYASSL_ENTER("StartMonitorCRL");
CYASSL_MSG("Not compiled in");
2012-05-23 04:25:15 +04:00
return NOT_COMPILED_IN;
}
#endif /* HAVE_CRL_MONITOR */
2012-05-17 04:04:56 +04:00
/* Load CRL path files of type, SSL_SUCCESS on ok */
int LoadCRL(CYASSL_CRL* crl, const char* path, int type, int monitor)
2012-05-17 04:04:56 +04:00
{
2012-05-25 07:10:38 +04:00
struct dirent* entry;
DIR* dir;
int ret = SSL_SUCCESS;
CYASSL_ENTER("LoadCRL");
if (crl == NULL)
return BAD_FUNC_ARG;
dir = opendir(path);
if (dir == NULL) {
CYASSL_MSG("opendir path crl load failed");
return BAD_PATH_ERROR;
}
while ( (entry = readdir(dir)) != NULL) {
char name[MAX_FILENAME_SZ];
struct stat s;
XMEMSET(name, 0, sizeof(name));
XSTRNCPY(name, path, MAX_FILENAME_SZ/2 - 2);
XSTRNCAT(name, "/", 1);
XSTRNCAT(name, entry->d_name, MAX_FILENAME_SZ/2);
if (stat(name, &s) != 0) {
CYASSL_MSG("stat on name failed");
continue;
}
if (s.st_mode & S_IFREG) {
2012-05-25 07:10:38 +04:00
if (type == SSL_FILETYPE_PEM) {
if (strstr(entry->d_name, ".pem") == NULL) {
CYASSL_MSG("not .pem file, skipping");
continue;
}
}
else {
if (strstr(entry->d_name, ".der") == NULL &&
strstr(entry->d_name, ".crl") == NULL) {
CYASSL_MSG("not .der or .crl file, skipping");
continue;
}
}
if (ProcessFile(NULL, name, type, CRL_TYPE, NULL, 0, crl)
2012-05-25 01:07:59 +04:00
!= SSL_SUCCESS) {
CYASSL_MSG("CRL file load failed, continuing");
}
2012-05-25 07:10:38 +04:00
}
}
2012-05-17 04:04:56 +04:00
2012-05-23 04:25:15 +04:00
if (monitor & CYASSL_CRL_MONITOR) {
CYASSL_MSG("monitor path requested");
2012-05-23 04:25:15 +04:00
if (type == SSL_FILETYPE_PEM) {
crl->monitors[0].path = strdup(path);
crl->monitors[0].type = SSL_FILETYPE_PEM;
if (crl->monitors[0].path == NULL)
ret = MEMORY_E;
} else {
crl->monitors[1].path = strdup(path);
crl->monitors[1].type = SSL_FILETYPE_ASN1;
if (crl->monitors[1].path == NULL)
ret = MEMORY_E;
}
if (monitor & CYASSL_CRL_START_MON) {
CYASSL_MSG("start monitoring requested");
ret = StartMonitorCRL(crl);
}
}
2012-11-27 23:36:36 +04:00
closedir(dir);
2012-05-25 07:10:38 +04:00
return ret;
2012-05-17 04:04:56 +04:00
}
2012-05-11 23:22:16 +04:00
#endif /* HAVE_CRL */