Commit 875a644a authored by Richard Levitte's avatar Richard Levitte
Browse files

Constify d2i, s2i, c2i and r2i functions and other associated

functions and macros.

This change has associated tags: LEVITTE_before_const and
LEVITTE_after_const.  Those will be removed when this change has been
properly reviewed.
parent ec37635c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@

 Changes between 0.9.7c and 0.9.8  [xx XXX xxxx]

  *) Constify all or almost all d2i, c2i, s2i and r2i functions, along with
     associated ASN1, EVP and SSL functions and old ASN1 macros.

  *) BN_zero() only needs to set 'top' and 'neg' to zero for correct results,
     and this should never fail. So the return value from the use of
     BN_set_word() (which can fail due to needless expansion) is now deprecated;
+1 −1
Original line number Diff line number Diff line
@@ -758,7 +758,7 @@ X509 *load_cert(BIO *err, const char *file, int format,
		x=d2i_X509_bio(cert,NULL);
	else if (format == FORMAT_NETSCAPE)
		{
		unsigned char *p,*op;
		const unsigned char *p,*op;
		int size=0,i;

		/* We sort of have to do it this way because it is sort of nice
+3 −1
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ int MAIN(int argc, char **argv)
	char *infile=NULL,*str=NULL,*prog,*oidfile=NULL, *derfile=NULL;
	char *genstr=NULL, *genconf=NULL;
	unsigned char *tmpbuf;
	const unsigned char *ctmpbuf;
	BUF_MEM *buf=NULL;
	STACK *osk=NULL;
	ASN1_TYPE *at=NULL;
@@ -317,7 +318,8 @@ bad:
			tmpbuf+=j;
			tmplen-=j;
			atmp = at;
			at = d2i_ASN1_TYPE(NULL,&tmpbuf,tmplen);
			ctmpbuf = tmpbuf;
			at = d2i_ASN1_TYPE(NULL,&ctmpbuf,tmplen);
			ASN1_TYPE_free(atmp);
			if(!at)
				{
+1 −1
Original line number Diff line number Diff line
@@ -811,7 +811,7 @@ err:
int alg_print (BIO *x, X509_ALGOR *alg)
{
	PBEPARAM *pbe;
	unsigned char *p;
	const unsigned char *p;
	p = alg->parameter->value.sequence->data;
	pbe = d2i_PBEPARAM (NULL, &p, alg->parameter->value.sequence->length);
	BIO_printf (bio_err, "%s, Iteration %ld\n", 
+4 −3
Original line number Diff line number Diff line
@@ -113,11 +113,12 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
	return(ret);
	}

ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, unsigned char **pp,
	     long len)
ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
	const unsigned char **pp, long len)
	{
	ASN1_BIT_STRING *ret=NULL;
	unsigned char *p,*s;
	const unsigned char *p;
	unsigned char *s;
	int i;

	if (len < 1)
Loading