mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
Fixes for it to compile and work nicely with Dropbear.
In particular, OS X's 'ar' doesn't seem to like arrays which don't have initialising values. --HG-- branch : libtomcrypt extra : convert_revision : 7ff4e3d69a4b17b01a3882777311f0f7664e4cda
This commit is contained in:
12
Makefile.in
12
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)
|
||||
|
||||
@@ -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},
|
||||
};
|
||||
|
||||
@@ -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},
|
||||
};
|
||||
|
||||
3
md5.c
3
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,
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
/* Various tidbits of modern neatoness */
|
||||
#define BASE64
|
||||
|
||||
#define FORTUNA_POOLS 0
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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 *);
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user