Commit 8623f693 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

New functions CONF_load_bio() and CONF_load_fp() to load a configuration

file from a bio or fp. Added some more constification to the BN library.
parent 11af1a27
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4,6 +4,11 @@

 Changes between 0.9.3a and 0.9.4

  *) New functions CONF_load_bio() and CONF_load_fp() to allow a config
     file to be loaded from a BIO or FILE pointer. The BIO version will
     for example allow memory BIOs to contain config info.
     [Steve Henson]

  *) New function "CRYPTO_num_locks" that returns CRYPTO_NUM_LOCKS.
     Whoever hopes to achieve shared-library compatibility across versions
     must use this, not the compile-time macro.
+6 −6
Original line number Diff line number Diff line
@@ -323,9 +323,9 @@ void BN_init(BIGNUM *);
void	BN_clear_free(BIGNUM *a);
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
BIGNUM *BN_bin2bn(const unsigned char *s,int len,BIGNUM *ret);
int	BN_bn2bin(BIGNUM *a, unsigned char *to);
int	BN_bn2bin(const BIGNUM *a, unsigned char *to);
BIGNUM *BN_mpi2bn(unsigned char *s,int len,BIGNUM *ret);
int	BN_bn2mpi(BIGNUM *a, unsigned char *to);
int	BN_bn2mpi(const BIGNUM *a, unsigned char *to);
int	BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
int	BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
int	BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
@@ -375,10 +375,10 @@ BIGNUM *BN_dup(const BIGNUM *a);
int	BN_ucmp(const BIGNUM *a, const BIGNUM *b);
int	BN_set_bit(BIGNUM *a, int n);
int	BN_clear_bit(BIGNUM *a, int n);
char *	BN_bn2hex(BIGNUM *a);
char *	BN_bn2dec(BIGNUM *a);
int 	BN_hex2bn(BIGNUM **a,char *str);
int 	BN_dec2bn(BIGNUM **a,char *str);
char *	BN_bn2hex(const BIGNUM *a);
char *	BN_bn2dec(const BIGNUM *a);
int 	BN_hex2bn(BIGNUM **a, const char *str);
int 	BN_dec2bn(BIGNUM **a, const char *str);
int	BN_gcd(BIGNUM *r,BIGNUM *in_a,BIGNUM *in_b,BN_CTX *ctx);
BIGNUM *BN_mod_inverse(BIGNUM *ret,BIGNUM *a, const BIGNUM *n,BN_CTX *ctx);
BIGNUM *BN_generate_prime(BIGNUM *ret,int bits,int strong,BIGNUM *add,
+1 −1
Original line number Diff line number Diff line
@@ -629,7 +629,7 @@ BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret)
	}

/* ignore negative */
int BN_bn2bin(BIGNUM *a, unsigned char *to)
int BN_bn2bin(const BIGNUM *a, unsigned char *to)
	{
	int n,i;
	BN_ULONG l;
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@
#include "cryptlib.h"
#include "bn_lcl.h"

int BN_bn2mpi(BIGNUM *a, unsigned char *d)
int BN_bn2mpi(const BIGNUM *a, unsigned char *d)
	{
	int bits;
	int num=0;
+4 −4
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@
static const char *Hex="0123456789ABCDEF";

/* Must 'Free' the returned data */
char *BN_bn2hex(BIGNUM *a)
char *BN_bn2hex(const BIGNUM *a)
	{
	int i,j,v,z=0;
	char *buf;
@@ -100,7 +100,7 @@ err:
	}

/* Must 'Free' the returned data */
char *BN_bn2dec(BIGNUM *a)
char *BN_bn2dec(const BIGNUM *a)
	{
	int i=0,num;
	char *buf=NULL;
@@ -154,7 +154,7 @@ err:
	return(buf);
	}

int BN_hex2bn(BIGNUM **bn, char *a)
int BN_hex2bn(BIGNUM **bn, const char *a)
	{
	BIGNUM *ret=NULL;
	BN_ULONG l=0;
@@ -220,7 +220,7 @@ err:
	return(0);
	}

int BN_dec2bn(BIGNUM **bn, char *a)
int BN_dec2bn(BIGNUM **bn, const char *a)
	{
	BIGNUM *ret=NULL;
	BN_ULONG l=0;
Loading