Commit 14f4feb0 authored by Richard Levitte's avatar Richard Levitte
Browse files

Recent changes from 0.9.6-stable.

parent 3ba2b94a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4,6 +4,11 @@

 Changes between 0.9.6g and 0.9.6h  [xx XXX xxxx]

  *) Change X509_NAME_cmp() so it applies the special rules on handling
     DN values that are of type PrintableString, as well as RDNs of type
     emailAddress where the value has the type ia5String.
     [stefank@valicert.com via Richard Levitte]

  *) Add a SSL_SESS_CACHE_NO_INTERNAL_STORE flag to take over half
     the job SSL_SESS_CACHE_NO_INTERNAL_LOOKUP was inconsistently
     doing, define a new flag (SSL_SESS_CACHE_NO_INTERNAL) to be
+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ do_gnu-shared:
	done

DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \
	my_ld=`gcc -print-prog-name=ld 2>&1` && \
	my_ld=`${CC} -print-prog-name=ld 2>&1` && \
	[ -n "$$my_ld" ] && \
	$$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1

+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ static char *x509_usage[]={
" -CAkey arg      - set the CA key, must be PEM format\n",
"                   missing, it is assumed to be in the CA file.\n",
" -CAcreateserial - create serial number file if it does not exist\n",
" -CAserial       - serial file\n",
" -CAserial arg   - serial file\n",
" -text           - print the certificate in text form\n",
" -C              - print out C code forms\n",
" -md2/-md5/-sha1/-mdc2 - digest to use\n",
+6 −3
Original line number Diff line number Diff line
@@ -473,7 +473,8 @@ case "$GUESSOS" in
	echo "WARNING! If you wish to build 64-bit library, then you have to"
	echo "         invoke './Configure irix64-mips4-$CC' *manually*."
	echo "         Type return if you want to continue, Ctrl-C to abort."
	read waste < /dev/tty
	# Do not stop if /dev/tty is unavailable
	(read waste < /dev/tty) || true
        CPU=`(hinv -t cpu) 2>/dev/null | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
        CPU=${CPU:-0}
        if [ $CPU -ge 5000 ]; then
@@ -528,7 +529,8 @@ EOF
	#echo "WARNING! If you wish to build 64-bit library, then you have to"
	#echo "         invoke './Configure linux64-sparcv9' *manually*."
	#echo "         Type return if you want to continue, Ctrl-C to abort."
	#read waste < /dev/tty
	# Do not stop if /dev/tty is unavailable
	#(read waste < /dev/tty) || true
	OUT="linux-sparcv9" ;;
  sparc-*-linux2)
	KARCH=`awk '/^type/{print$3}' /proc/cpuinfo`
@@ -569,7 +571,8 @@ EOF
		echo "WARNING! If you wish to build 64-bit library, then you have to"
		echo "         invoke './Configure solaris64-sparcv9-cc' *manually*."
		echo "         Type return if you want to continue, Ctrl-C to abort."
		read waste < /dev/tty
		# Do not stop if /dev/tty is unavailable
		(read waste < /dev/tty) || true
	fi
	OUT="solaris-sparcv9-$CC" ;;
  sun4m-*-solaris2)	OUT="solaris-sparcv8-$CC" ;;
+106 −3
Original line number Diff line number Diff line
@@ -157,6 +157,99 @@ int X509_cmp(const X509 *a, const X509 *b)
}
#endif


/* Case insensitive string comparision */
static int nocase_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
{
	int i;

	if (a->length != b->length)
		return (a->length - b->length);

	for (i=0; i<a->length; i++)
	{
		int ca, cb;

		ca = tolower(a->data[i]);
		cb = tolower(b->data[i]);

		if (ca != cb)
			return(ca-cb);
	}
	return 0;
}

/* Case insensitive string comparision with space normalization 
 * Space normalization - ignore leading, trailing spaces, 
 *       multiple spaces between characters are replaced by single space  
 */
static int nocase_spacenorm_cmp(const ASN1_STRING *a, const ASN1_STRING *b)
{
	unsigned char *pa = NULL, *pb = NULL;
	int la, lb;
	
	la = a->length;
	lb = b->length;
	pa = a->data;
	pb = b->data;

	/* skip leading spaces */
	while (la > 0 && isspace(*pa))
	{
		la--;
		pa++;
	}
	while (lb > 0 && isspace(*pb))
	{
		lb--;
		pb++;
	}

	/* skip trailing spaces */
	while (la > 0 && isspace(pa[la-1]))
		la--;
	while (lb > 0 && isspace(pb[lb-1]))
		lb--;

	/* compare strings with space normalization */
	while (la > 0 && lb > 0)
	{
		int ca, cb;

		/* compare character */
		ca = tolower(*pa);
		cb = tolower(*pb);
		if (ca != cb)
			return (ca - cb);

		pa++; pb++;
		la--; lb--;

		if (la <= 0 || lb <= 0)
			break;

		/* is white space next character ? */
		if (isspace(*pa) && isspace(*pb))
		{
			/* skip remaining white spaces */
			while (la > 0 && isspace(*pa))
			{
				la--;
				pa++;
			}
			while (lb > 0 && isspace(*pb))
			{
				lb--;
				pb++;
			}
		}
	}
	if (la > 0 || lb > 0)
		return la - lb;

	return 0;
}

int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b)
	{
	int i,j;
@@ -170,10 +263,20 @@ int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b)
		{
		na=sk_X509_NAME_ENTRY_value(a->entries,i);
		nb=sk_X509_NAME_ENTRY_value(b->entries,i);
		j=na->value->type-nb->value->type;
		if (j) return(j);
		if (na->value->type == V_ASN1_PRINTABLESTRING)
			j=nocase_spacenorm_cmp(na->value, nb->value);
		else if (na->value->type == V_ASN1_IA5STRING
			&& OBJ_obj2nid(na->object) == NID_pkcs9_emailAddress)
			j=nocase_cmp(na->value, nb->value);
		else
			{
			j=na->value->length-nb->value->length;
			if (j) return(j);
			j=memcmp(na->value->data,nb->value->data,
				na->value->length);
			}
		if (j) return(j);
		j=na->set-nb->set;
		if (j) return(j);
Loading