2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 2 of the License, or
5
* (at your option) any later version.
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software
14
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
* Author : Gundu RAO - 16 Jul 2004
17
* From Hewlett Packard Company.
19
#ifndef _ccnv_2_common_h_H
20
#define _ccnv_2_common_h_H
22
#include <openssl/bio.h>
23
#include <openssl/err.h>
24
#include <openssl/rand.h>
25
#include <openssl/ssl.h>
26
#include <openssl/x509v3.h>
29
#define MUTEX_TYPE pthread_mutex_t
30
#define MUTEX_SETUP(x) pthread_mutex_init(&(x), NULL)
31
#define MUTEX_CLEANUP(x) pthread_mutex_destroy(&(x))
32
#define MUTEX_LOCK(x) pthread_mutex_lock(&(x))
33
#define MUTEX_UNLOCK(x) pthread_mutex_unlock(&(x))
34
#define THREAD_ID pthread_self( )
37
** Define a global variable for the SSL context
40
#define CERTFILE "cacert.pem"
41
#define PRIVATE_KEY_FILE "cakey.pem"
43
/* Initialises an SSL context and makes the lib thread safe */
51
int init_OpenSSL(void);
56
int Thread_setup(void);
61
SSL_CTX *setup_ssl_context(SSL_METHOD *);
71
// int createAuthHeader(char * user, char * password, char * method, char * uri, char * msgbody, char * auth, char * result);