Commit 439df508 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

Fix c_rehash script, add -fingerprint option to crl.

parent 0d3b0afe
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4,6 +4,12 @@

 Changes between 0.9.5a and 0.9.6  [xx XXX 2000]

  *) Enhance c_rehash script. Old version would mishandle certificates
     with the same subject name hash and wouldn't handle CRLs at all.
     Added -fingerprint option to crl utility, to support new c_rehash
     features.
     [Steve Henson]

  *) Eliminate non-ANSI declarations in crypto.h and stack.h.
	 [Ulf Möller]

+2 −1
Original line number Diff line number Diff line
@@ -890,12 +890,13 @@ EOF
	### (system 'make depend') == 0 or exit $? if $depflags ne "";
	# Run "make depend" manually if you want to be able to delete
	# the source code files of ciphers you left out.
	&dofile("tools/c_rehash",$openssldir,'^DIR=',	'DIR=%s',);
	if ( $perl =~ m@^/@) {
	    &dofile("tools/c_rehash",$perl,'^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
	    &dofile("apps/der_chop",$perl,'^#!/', '#!%s');
	    &dofile("apps/CA.pl",$perl,'^#!/', '#!%s');
	} else {
	    # No path for Perl known ...
	    &dofile("tools/c_rehash",'/usr/local/bin/perl','^#!/', '#!%s','^my \$dir;$', 'my $dir = "' . $openssldir . '";');
	    &dofile("apps/der_chop",'/usr/local/bin/perl','^#!/', '#!%s');
	    &dofile("apps/CA.pl",'/usr/local/bin/perl','^#!/', '#!%s');
	}	    
+1 −1
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ dclean:

rehash: rehash.time
rehash.time: certs
	@(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; sh tools/c_rehash certs)
	@(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; $(PERL) tools/c_rehash certs)
	touch rehash.time

test:   tests
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ $(DLIBCRYPTO):
$(PROGRAM): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL)
	$(RM) $(PROGRAM)
	$(CC) -o $(PROGRAM) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) $(LIBCRYPTO) $(EX_LIBS)
	@(cd ..; OPENSSL="`pwd`/apps/openssl"; export OPENSSL; sh tools/c_rehash certs)
	@(cd ..; OPENSSL="`pwd`/apps/openssl"; export OPENSSL; $(PERL) tools/c_rehash certs)

progs.h: progs.pl
	$(PERL) progs.pl $(E_EXE) >progs.h
+29 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ int MAIN(int argc, char **argv)
	int informat,outformat;
	char *infile=NULL,*outfile=NULL;
	int hash=0,issuer=0,lastupdate=0,nextupdate=0,noout=0,text=0;
	int fingerprint = 0;
	char **pp,buf[256];
	X509_STORE *store = NULL;
	X509_STORE_CTX ctx;
@@ -111,6 +112,7 @@ int MAIN(int argc, char **argv)
	X509_OBJECT xobj;
	EVP_PKEY *pkey;
	int do_ver = 0;
	const EVP_MD *md_alg,*digest=EVP_md5();

	apps_startup();

@@ -183,6 +185,13 @@ int MAIN(int argc, char **argv)
			nextupdate= ++num;
		else if (strcmp(*argv,"-noout") == 0)
			noout= ++num;
		else if (strcmp(*argv,"-fingerprint") == 0)
			fingerprint= ++num;
		else if ((md_alg=EVP_get_digestbyname(*argv + 1)))
			{
			/* ok */
			digest=md_alg;
			}
		else
			{
			BIO_printf(bio_err,"unknown option %s\n",*argv);
@@ -274,6 +283,26 @@ bad:
					BIO_printf(bio_out,"NONE");
				BIO_printf(bio_out,"\n");
				}
			if (fingerprint == i)
				{
				int j;
				unsigned int n;
				unsigned char md[EVP_MAX_MD_SIZE];

				if (!X509_CRL_digest(x,digest,md,&n))
					{
					BIO_printf(bio_err,"out of memory\n");
					goto end;
					}
				BIO_printf(bio_out,"%s Fingerprint=",
						OBJ_nid2sn(EVP_MD_type(digest)));
				for (j=0; j<(int)n; j++)
					{
					BIO_printf(bio_out,"%02X%c",md[j],
						(j+1 == (int)n)
						?'\n':':');
					}
				}
			}
		}

Loading