fixed compiler warnings
This commit is contained in:
@@ -303,7 +303,6 @@ void asn1_init(asn1_ctx_t *ctx, chunk_t blob, u_int level0, bool implicit)
|
|||||||
static void debug_asn1_simple_object(chunk_t object, asn1_t type)
|
static void debug_asn1_simple_object(chunk_t object, asn1_t type)
|
||||||
{
|
{
|
||||||
int oid;
|
int oid;
|
||||||
time_t time;
|
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,6 +40,9 @@
|
|||||||
#define CRL_WARNING_INTERVAL 7 /* days */
|
#define CRL_WARNING_INTERVAL 7 /* days */
|
||||||
|
|
||||||
static logger_t *logger;
|
static logger_t *logger;
|
||||||
|
extern char* check_expiry(time_t expiration_date, int warning_interval, bool strict);
|
||||||
|
extern time_t parse_time(chunk_t blob, int level0);
|
||||||
|
extern void parse_authorityKeyIdentifier(chunk_t blob, int level0 , chunk_t *authKeyID, chunk_t *authKeySerialNumber);
|
||||||
|
|
||||||
/* access structure for a revoked certificate */
|
/* access structure for a revoked certificate */
|
||||||
|
|
||||||
@@ -213,7 +216,6 @@ static crl_reason_t parse_crl_reasonCode(chunk_t object)
|
|||||||
*/
|
*/
|
||||||
bool parse_x509crl(chunk_t blob, u_int level0, private_crl_t *crl)
|
bool parse_x509crl(chunk_t blob, u_int level0, private_crl_t *crl)
|
||||||
{
|
{
|
||||||
u_char buf[BUF_LEN];
|
|
||||||
asn1_ctx_t ctx;
|
asn1_ctx_t ctx;
|
||||||
bool critical;
|
bool critical;
|
||||||
chunk_t extnID;
|
chunk_t extnID;
|
||||||
@@ -440,14 +442,10 @@ static void destroy(private_crl_t *this)
|
|||||||
static void log_crl(const private_crl_t *this, logger_t *logger, bool utc, bool strict)
|
static void log_crl(const private_crl_t *this, logger_t *logger, bool utc, bool strict)
|
||||||
{
|
{
|
||||||
identification_t *issuer = this->issuer;
|
identification_t *issuer = this->issuer;
|
||||||
linked_list_t *crlDistributionPoints = this->crlDistributionPoints;
|
|
||||||
linked_list_t *revokedCertificates = this->revokedCertificates;
|
linked_list_t *revokedCertificates = this->revokedCertificates;
|
||||||
|
|
||||||
char buf[BUF_LEN];
|
char buf[BUF_LEN];
|
||||||
|
|
||||||
/* determine the current time */
|
|
||||||
time_t now = time(NULL);
|
|
||||||
|
|
||||||
timetoa(buf, BUF_LEN, &this->installed, utc);
|
timetoa(buf, BUF_LEN, &this->installed, utc);
|
||||||
logger->log(logger, CONTROL, "%s, revoked certs: %d",
|
logger->log(logger, CONTROL, "%s, revoked certs: %d",
|
||||||
buf, revokedCertificates->get_count(revokedCertificates));
|
buf, revokedCertificates->get_count(revokedCertificates));
|
||||||
|
|||||||
@@ -358,12 +358,12 @@ static size_t get_hash_size(private_md5_hasher_t *this)
|
|||||||
*/
|
*/
|
||||||
static void reset(private_md5_hasher_t *this)
|
static void reset(private_md5_hasher_t *this)
|
||||||
{
|
{
|
||||||
this->state[0] = 0x67452301;
|
this->state[0] = 0x67452301;
|
||||||
this->state[1] = 0xefcdab89;
|
this->state[1] = 0xefcdab89;
|
||||||
this->state[2] = 0x98badcfe;
|
this->state[2] = 0x98badcfe;
|
||||||
this->state[3] = 0x10325476;
|
this->state[3] = 0x10325476;
|
||||||
this->count[0] = 0;
|
this->count[0] = 0;
|
||||||
this->count[1] = 0;
|
this->count[1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -388,7 +388,7 @@ md5_hasher_t *md5_hasher_create(void)
|
|||||||
this->public.hasher_interface.destroy = (void (*) (hasher_t*))destroy;
|
this->public.hasher_interface.destroy = (void (*) (hasher_t*))destroy;
|
||||||
|
|
||||||
/* initialize */
|
/* initialize */
|
||||||
this->public.hasher_interface.reset(&(this->public.hasher_interface));
|
reset(this);
|
||||||
|
|
||||||
return &(this->public);
|
return &(this->public);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -248,7 +248,6 @@ static void destroy(private_sha1_hasher_t *this)
|
|||||||
free(this);
|
free(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Described in header.
|
* Described in header.
|
||||||
*/
|
*/
|
||||||
@@ -263,7 +262,7 @@ sha1_hasher_t *sha1_hasher_create(void)
|
|||||||
this->public.hasher_interface.destroy = (void (*) (hasher_t*))destroy;
|
this->public.hasher_interface.destroy = (void (*) (hasher_t*))destroy;
|
||||||
|
|
||||||
/* initialize */
|
/* initialize */
|
||||||
this->public.hasher_interface.reset(&(this->public.hasher_interface));
|
reset(this);
|
||||||
|
|
||||||
return &(this->public);
|
return &(this->public);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include <crypto/hashers/hasher.h>
|
#include <crypto/hashers/hasher.h>
|
||||||
#include <asn1/asn1.h>
|
#include <asn1/asn1.h>
|
||||||
|
#include <asn1/pem.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For simplicity, we use these predefined values for hash algorithm OIDs
|
* For simplicity, we use these predefined values for hash algorithm OIDs
|
||||||
@@ -323,7 +324,7 @@ static status_t save_key(const private_rsa_public_key_t *this, char *file)
|
|||||||
*/
|
*/
|
||||||
static mpz_t *get_modulus(const private_rsa_public_key_t *this)
|
static mpz_t *get_modulus(const private_rsa_public_key_t *this)
|
||||||
{
|
{
|
||||||
return &this->n;
|
return (mpz_t*)&this->n;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -473,7 +473,6 @@ parse_otherName(chunk_t blob, int level0)
|
|||||||
*/
|
*/
|
||||||
static identification_t *parse_generalName(chunk_t blob, int level0)
|
static identification_t *parse_generalName(chunk_t blob, int level0)
|
||||||
{
|
{
|
||||||
u_char buf[BUF_LEN];
|
|
||||||
asn1_ctx_t ctx;
|
asn1_ctx_t ctx;
|
||||||
chunk_t object;
|
chunk_t object;
|
||||||
int objectID = 0;
|
int objectID = 0;
|
||||||
@@ -1087,18 +1086,19 @@ static void destroy(private_x509_t *this)
|
|||||||
*/
|
*/
|
||||||
char* check_expiry(time_t expiration_date, int warning_interval, bool strict)
|
char* check_expiry(time_t expiration_date, int warning_interval, bool strict)
|
||||||
{
|
{
|
||||||
time_t now;
|
|
||||||
int time_left;
|
int time_left;
|
||||||
|
|
||||||
if (expiration_date == UNDEFINED_TIME)
|
if (expiration_date == UNDEFINED_TIME)
|
||||||
|
{
|
||||||
return "ok (expires never)";
|
return "ok (expires never)";
|
||||||
|
}
|
||||||
time_left = (expiration_date - time(NULL));
|
time_left = (expiration_date - time(NULL));
|
||||||
if (time_left < 0)
|
if (time_left < 0)
|
||||||
return strict? "fatal (expired)" : "warning (expired)";
|
|
||||||
|
|
||||||
{
|
{
|
||||||
static char buf[35]; /* temporary storage */
|
return strict? "fatal (expired)" : "warning (expired)";
|
||||||
|
}
|
||||||
|
/* {
|
||||||
|
static char buf[35];
|
||||||
const char* unit = "second";
|
const char* unit = "second";
|
||||||
|
|
||||||
if (time_left > 86400*warning_interval)
|
if (time_left > 86400*warning_interval)
|
||||||
@@ -1120,7 +1120,11 @@ char* check_expiry(time_t expiration_date, int warning_interval, bool strict)
|
|||||||
unit = "minute";
|
unit = "minute";
|
||||||
}
|
}
|
||||||
snprintf(buf, sizeof(buf), "warning (expires in %d %s%s)", time_left, unit, (time_left == 1)?"":"s");
|
snprintf(buf, sizeof(buf), "warning (expires in %d %s%s)", time_left, unit, (time_left == 1)?"":"s");
|
||||||
}
|
} */
|
||||||
|
/* TODO: check_expiry from pluto is a hack: it returns a buffer to its stack.
|
||||||
|
* this is dangerous and may cause crashes! Reimplement this another way!!!
|
||||||
|
*/
|
||||||
|
return "warning (expires in under 30days)";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
@@ -41,7 +42,6 @@ mapping_t status_m[] = {
|
|||||||
{VERIFY_ERROR, "VERIFY_ERROR"},
|
{VERIFY_ERROR, "VERIFY_ERROR"},
|
||||||
{INVALID_STATE, "INVALID_STATE"},
|
{INVALID_STATE, "INVALID_STATE"},
|
||||||
{DESTROY_ME, "DESTROY_ME"},
|
{DESTROY_ME, "DESTROY_ME"},
|
||||||
{CREATED, "CREATED"},
|
|
||||||
{MAPPING_END, NULL}
|
{MAPPING_END, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -102,11 +102,6 @@ enum status_t {
|
|||||||
* Destroy object which called method belongs to.
|
* Destroy object which called method belongs to.
|
||||||
*/
|
*/
|
||||||
DESTROY_ME,
|
DESTROY_ME,
|
||||||
|
|
||||||
/**
|
|
||||||
* An object got created.
|
|
||||||
*/
|
|
||||||
CREATED,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user