diff --git a/Makefile.in b/Makefile.in index ad59743..7782416 100644 --- a/Makefile.in +++ b/Makefile.in @@ -6,6 +6,9 @@ # The version VERSION=0.99 +VPATH=@srcdir@ +srcdir=@srcdir@ + # Compiler and Linker Names #CC=gcc #LD=ld @@ -111,15 +114,6 @@ hash_file.o hash_filehandle.o hash_memory.o \ \ hmac_done.o hmac_file.o hmac_init.o hmac_memory.o hmac_process.o hmac_test.o \ \ -pkcs_1_mgf1.o pkcs_1_oaep_encode.o pkcs_1_oaep_decode.o \ -pkcs_1_pss_encode.o pkcs_1_pss_decode.o pkcs_1_i2osp.o pkcs_1_os2ip.o \ -pkcs_1_v15_es_encode.o pkcs_1_v15_es_decode.o pkcs_1_v15_sa_encode.o pkcs_1_v15_sa_decode.o \ -\ -pkcs_5_1.o pkcs_5_2.o \ -\ -der_encode_integer.o der_decode_integer.o der_length_integer.o \ -der_put_multi_integer.o der_get_multi_integer.o \ -\ burn_stack.o zeromem.o \ \ $(MPIOBJECT) diff --git a/crypt_cipher_descriptor.c b/crypt_cipher_descriptor.c index 4a8a943..97a142c 100644 --- a/crypt_cipher_descriptor.c +++ b/crypt_cipher_descriptor.c @@ -10,5 +10,12 @@ */ #include "mycrypt.h" -struct _cipher_descriptor cipher_descriptor[TAB_SIZE]; - +struct _cipher_descriptor cipher_descriptor[TAB_SIZE] = { + /* This is ugly, but OS X's ar seems broken and leaves the + * cipher_descriptor symbol out of the .a if we don't + * initialise it here. */ + {NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL}, + {NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL}, + {NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL}, + {NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL}, +}; diff --git a/crypt_hash_descriptor.c b/crypt_hash_descriptor.c index 5c02255..35316c6 100644 --- a/crypt_hash_descriptor.c +++ b/crypt_hash_descriptor.c @@ -10,5 +10,10 @@ */ #include "mycrypt.h" -struct _hash_descriptor hash_descriptor[TAB_SIZE]; - +struct _hash_descriptor hash_descriptor[TAB_SIZE] = { + /* OS X has a broken ar, so we need to initialise. */ + {NULL, 0, 0, 0, NULL, NULL, NULL, NULL}, + {NULL, 0, 0, 0, NULL, NULL, NULL, NULL}, + {NULL, 0, 0, 0, NULL, NULL, NULL, NULL}, + {NULL, 0, 0, 0, NULL, NULL, NULL, NULL}, +}; diff --git a/md5.c b/md5.c index 5339169..61a0fed 100644 --- a/md5.c +++ b/md5.c @@ -23,10 +23,13 @@ const struct _hash_descriptor md5_desc = 64, /* DER identifier */ +#if 0 + /* matt */ { 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x02, 0x05, 0x05, 0x00, 0x04, 0x10 }, 18, +#endif &md5_init, &md5_process, diff --git a/mycrypt_custom.h b/mycrypt_custom.h index bf9cfb0..678ef64 100644 --- a/mycrypt_custom.h +++ b/mycrypt_custom.h @@ -74,6 +74,7 @@ /* Various tidbits of modern neatoness */ #define BASE64 +#define FORTUNA_POOLS 0 #endif diff --git a/mycrypt_hash.h b/mycrypt_hash.h index d5d8900..002cd28 100644 --- a/mycrypt_hash.h +++ b/mycrypt_hash.h @@ -127,8 +127,11 @@ extern struct _hash_descriptor { unsigned char ID; unsigned long hashsize; /* digest output size in bytes */ unsigned long blocksize; /* the block size the hash uses */ +#if 0 + /*matt - we don't need these and they make the intialisers more ugly.*/ unsigned char DER[64]; /* DER encoded identifier */ unsigned long DERlen; /* length of DER encoding */ +#endif int (*init)(hash_state *); int (*process)(hash_state *, const unsigned char *, unsigned long); int (*done)(hash_state *, unsigned char *); diff --git a/mycrypt_pk.h b/mycrypt_pk.h index 6345116..1b6471b 100644 --- a/mycrypt_pk.h +++ b/mycrypt_pk.h @@ -276,10 +276,13 @@ typedef struct { #endif +/* ifdef added by matt - a bit of a hack */ +#ifdef MPI /* DER handling */ int der_encode_integer(mp_int *num, unsigned char *out, unsigned long *outlen); int der_decode_integer(const unsigned char *in, unsigned long *inlen, mp_int *num); int der_length_integer(mp_int *num, unsigned long *len); int der_put_multi_integer(unsigned char *dst, unsigned long *outlen, mp_int *num, ...); int der_get_multi_integer(const unsigned char *src, unsigned long *inlen, mp_int *num, ...); +#endif diff --git a/sha1.c b/sha1.c index d6e57c3..1b4b4cc 100644 --- a/sha1.c +++ b/sha1.c @@ -21,10 +21,13 @@ const struct _hash_descriptor sha1_desc = 20, 64, +#if 0 + /* matt */ /* DER identifier */ { 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05, 0x00, 0x04, 0x14 }, 15, +#endif &sha1_init, &sha1_process,