Compare commits
	
		
			207 Commits
		
	
	
		
			OpenSSL-fi
			...
			OpenSSL_1_
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					65fc4c55be | ||
| 
						 | 
					5135d6b985 | ||
| 
						 | 
					2202edeff0 | ||
| 
						 | 
					c8f759ec74 | ||
| 
						 | 
					5fda10c6f1 | ||
| 
						 | 
					11ba084e1b | ||
| 
						 | 
					cddd00166c | ||
| 
						 | 
					0190aa7353 | ||
| 
						 | 
					1546de87f0 | ||
| 
						 | 
					affffaed3d | ||
| 
						 | 
					0c644f1462 | ||
| 
						 | 
					a2da5c7daa | ||
| 
						 | 
					c155d83f5b | ||
| 
						 | 
					5a03e3ac3f | ||
| 
						 | 
					08b2097967 | ||
| 
						 | 
					15401859b5 | ||
| 
						 | 
					6f24165170 | ||
| 
						 | 
					a8afd9382c | ||
| 
						 | 
					caddf00d78 | ||
| 
						 | 
					e105098b3f | ||
| 
						 | 
					9852e7e4d7 | ||
| 
						 | 
					b855560192 | ||
| 
						 | 
					f2f50efea3 | ||
| 
						 | 
					2b3cd246e5 | ||
| 
						 | 
					7171ade2c2 | ||
| 
						 | 
					76ec9151d1 | ||
| 
						 | 
					6c24dd9005 | ||
| 
						 | 
					e323afb0ce | ||
| 
						 | 
					1fd43fd86e | ||
| 
						 | 
					3e70c81ed9 | ||
| 
						 | 
					6e07229564 | ||
| 
						 | 
					859d5eb2d7 | ||
| 
						 | 
					29b0c4a01c | ||
| 
						 | 
					b824f0f458 | ||
| 
						 | 
					43ea53a04a | ||
| 
						 | 
					fa07f00aaf | ||
| 
						 | 
					dbb834ffeb | ||
| 
						 | 
					8549a8a5dc | ||
| 
						 | 
					887c250852 | ||
| 
						 | 
					710c1c34d1 | ||
| 
						 | 
					e16818108f | ||
| 
						 | 
					0cb76e79df | ||
| 
						 | 
					6cb419673e | ||
| 
						 | 
					72d668c332 | ||
| 
						 | 
					5ce4799a38 | ||
| 
						 | 
					6178da0142 | ||
| 
						 | 
					27713e3fc2 | ||
| 
						 | 
					3492c47b18 | ||
| 
						 | 
					43dc001b62 | ||
| 
						 | 
					8280b43a62 | ||
| 
						 | 
					85d9b02d16 | ||
| 
						 | 
					bfd502f027 | ||
| 
						 | 
					f1ed5fa827 | ||
| 
						 | 
					5bb9e1b4d4 | ||
| 
						 | 
					7de819237d | ||
| 
						 | 
					6cfab29b71 | ||
| 
						 | 
					55708796af | ||
| 
						 | 
					7074f1df07 | ||
| 
						 | 
					67d8ab07e6 | ||
| 
						 | 
					4e63da0669 | ||
| 
						 | 
					15b0a5651c | ||
| 
						 | 
					4e66723517 | ||
| 
						 | 
					3e53c86001 | ||
| 
						 | 
					524e5b844b | ||
| 
						 | 
					e1f09dfd84 | ||
| 
						 | 
					f16411ccfd | ||
| 
						 | 
					2bbcd45b05 | ||
| 
						 | 
					fdc6c6ef08 | ||
| 
						 | 
					6e87cc8da6 | ||
| 
						 | 
					2d0b6c72b8 | ||
| 
						 | 
					3e84046f90 | ||
| 
						 | 
					cc1cb996f1 | ||
| 
						 | 
					32fbeacdfb | ||
| 
						 | 
					431aad3c15 | ||
| 
						 | 
					0454f2c490 | ||
| 
						 | 
					5f911774bf | ||
| 
						 | 
					66b7e42790 | ||
| 
						 | 
					6a419388fc | ||
| 
						 | 
					abda7c1147 | ||
| 
						 | 
					88b48dc680 | ||
| 
						 | 
					661d35dfb2 | ||
| 
						 | 
					f99c9daa39 | ||
| 
						 | 
					019b3f3e5a | ||
| 
						 | 
					d6584eba8c | ||
| 
						 | 
					a379c433a3 | ||
| 
						 | 
					006c7c6bb1 | ||
| 
						 | 
					bd4a902a15 | ||
| 
						 | 
					17ae5e9f13 | ||
| 
						 | 
					baa5f52422 | ||
| 
						 | 
					b3620451b2 | ||
| 
						 | 
					d2f17d9615 | ||
| 
						 | 
					561cbe5678 | ||
| 
						 | 
					756d2074b8 | ||
| 
						 | 
					c65db618bb | ||
| 
						 | 
					8355647403 | ||
| 
						 | 
					b839d73411 | ||
| 
						 | 
					4563c1e043 | ||
| 
						 | 
					11f35a036d | ||
| 
						 | 
					d8646dab14 | ||
| 
						 | 
					47b3cd98f2 | ||
| 
						 | 
					27c7e53882 | ||
| 
						 | 
					b2b28803fb | ||
| 
						 | 
					8e92b1b9ce | ||
| 
						 | 
					0f41ccf370 | ||
| 
						 | 
					c44544a1d7 | ||
| 
						 | 
					4e50f02638 | ||
| 
						 | 
					174ea15647 | ||
| 
						 | 
					18f8258a87 | ||
| 
						 | 
					376bbb5887 | ||
| 
						 | 
					2c8275409e | ||
| 
						 | 
					892582b541 | ||
| 
						 | 
					57b53c1b0a | ||
| 
						 | 
					004c3ca521 | ||
| 
						 | 
					f0f00f9272 | ||
| 
						 | 
					a243c68736 | ||
| 
						 | 
					467d9f2a34 | ||
| 
						 | 
					226a94963a | ||
| 
						 | 
					d7f0d147b1 | ||
| 
						 | 
					26902b9aad | ||
| 
						 | 
					3c69d6bec4 | ||
| 
						 | 
					4f44677a41 | ||
| 
						 | 
					88d9f669c5 | ||
| 
						 | 
					22e1421672 | ||
| 
						 | 
					5409414eff | ||
| 
						 | 
					7134507de0 | ||
| 
						 | 
					fe41d9853c | ||
| 
						 | 
					d07692cd96 | ||
| 
						 | 
					82ae57136b | ||
| 
						 | 
					30baeaaeab | ||
| 
						 | 
					87a0f4b92e | ||
| 
						 | 
					1b08bcbfe3 | ||
| 
						 | 
					346b1001eb | ||
| 
						 | 
					b61a84c8e6 | ||
| 
						 | 
					a543ea44bc | ||
| 
						 | 
					b0dd3d1b94 | ||
| 
						 | 
					461be68b75 | ||
| 
						 | 
					21fb688d26 | ||
| 
						 | 
					d8faad27b7 | ||
| 
						 | 
					dab7075946 | ||
| 
						 | 
					dfc8e96daa | ||
| 
						 | 
					71d3eaf358 | ||
| 
						 | 
					ef6b25be63 | ||
| 
						 | 
					b452f43322 | ||
| 
						 | 
					52891f832f | ||
| 
						 | 
					9990cb75c1 | ||
| 
						 | 
					a5cc69c7ae | ||
| 
						 | 
					0b4b8ba64e | ||
| 
						 | 
					268e78c305 | ||
| 
						 | 
					c900a78c99 | ||
| 
						 | 
					46ffb2dc97 | ||
| 
						 | 
					10acacb3bf | ||
| 
						 | 
					aab790a656 | ||
| 
						 | 
					1319aad994 | ||
| 
						 | 
					3c0ce01cea | ||
| 
						 | 
					9fcbefebdb | ||
| 
						 | 
					017d2a887f | ||
| 
						 | 
					0416482605 | ||
| 
						 | 
					0f17424918 | ||
| 
						 | 
					55ed10db21 | ||
| 
						 | 
					3877b6bfe9 | ||
| 
						 | 
					a0f32454b6 | ||
| 
						 | 
					6fda4d7e5d | ||
| 
						 | 
					36a252ea46 | ||
| 
						 | 
					a31a195246 | ||
| 
						 | 
					5f590d2218 | ||
| 
						 | 
					791b7bc715 | ||
| 
						 | 
					19ae090787 | ||
| 
						 | 
					db3076621b | ||
| 
						 | 
					9ae5743515 | ||
| 
						 | 
					c184b140df | ||
| 
						 | 
					9d80aa7e3f | ||
| 
						 | 
					15671a90a9 | ||
| 
						 | 
					0048464449 | ||
| 
						 | 
					b422166ce0 | ||
| 
						 | 
					81be661ae2 | ||
| 
						 | 
					8681c66eec | ||
| 
						 | 
					69a0034e50 | ||
| 
						 | 
					c9a1778134 | ||
| 
						 | 
					326794e9c6 | ||
| 
						 | 
					2dd5ca1fbc | ||
| 
						 | 
					3042945ac8 | ||
| 
						 | 
					da29b0d335 | ||
| 
						 | 
					6abbc68188 | ||
| 
						 | 
					25f6c7fd8b | ||
| 
						 | 
					1cf3571ea4 | ||
| 
						 | 
					d769e7a58c | ||
| 
						 | 
					fa3619f233 | ||
| 
						 | 
					a414cbcad3 | ||
| 
						 | 
					c6196da587 | ||
| 
						 | 
					5d48762647 | ||
| 
						 | 
					77e749405d | ||
| 
						 | 
					9ccd4e224f | ||
| 
						 | 
					1dad4f3672 | ||
| 
						 | 
					59745556b4 | ||
| 
						 | 
					fab4447179 | ||
| 
						 | 
					417b8d4705 | ||
| 
						 | 
					e614ec4769 | ||
| 
						 | 
					a6b03f4138 | ||
| 
						 | 
					809fa4cc59 | ||
| 
						 | 
					463f448595 | ||
| 
						 | 
					5cd0cf8cce | ||
| 
						 | 
					49cb959494 | ||
| 
						 | 
					783a73c47f | ||
| 
						 | 
					99bf516908 | ||
| 
						 | 
					a26c372cfc | ||
| 
						 | 
					ed5ac22e5b | ||
| 
						 | 
					3d11b8f896 | 
							
								
								
									
										89
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										89
									
								
								CHANGES
									
									
									
									
									
								
							@@ -4,6 +4,55 @@
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8k and 1.0  [xx XXX xxxx]
 | 
			
		||||
 | 
			
		||||
  *) Delete MD2 from algorithm tables. This follows the recommendation in 
 | 
			
		||||
     several standards that it is not used in new applications due to
 | 
			
		||||
     several cryptographic weaknesses. The algorithm is also disabled in
 | 
			
		||||
     the default configuration.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) In BIO_pop() and BIO_push() use the ctrl argument (which was NULL) to
 | 
			
		||||
     indicate the initial BIO being pushed or popped. This makes it possible
 | 
			
		||||
     to determine whether the BIO is the one explicitly called or as a result
 | 
			
		||||
     of the ctrl being passed down the chain. Fix BIO_pop() and SSL BIOs so
 | 
			
		||||
     it handles reference counts correctly and doesn't zero out the I/O bio
 | 
			
		||||
     when it is not being explicitly popped. WARNING: applications which
 | 
			
		||||
     included workarounds for the old buggy behaviour will need to be modified
 | 
			
		||||
     or they could free up already freed BIOs.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Rename uni2asc and asc2uni functions to OPENSSL_uni2asc and
 | 
			
		||||
     OPENSSL_asc2uni the original names were too generic and cause name
 | 
			
		||||
     clashes on Netware.
 | 
			
		||||
     [Guenter <lists@gknw.net>]
 | 
			
		||||
 | 
			
		||||
  *) Add ECDHE and PSK support to DTLS.
 | 
			
		||||
     [Michael Tuexen <tuexen@fh-muenster.de>]
 | 
			
		||||
 | 
			
		||||
  *) Add CHECKED_STACK_OF macro to safestack.h, otherwise safestack can't
 | 
			
		||||
     be used on C++.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Add "missing" function EVP_MD_flags() (without this the only way to
 | 
			
		||||
     retrieve a digest flags is by accessing the structure directly. Update
 | 
			
		||||
     EVP_MD_do_all*() and EVP_CIPHER_do_all*() to include the name a digest
 | 
			
		||||
     or cipher is registered as in the "from" argument. Print out all
 | 
			
		||||
     registered digests in the dgst usage message instead of manually 
 | 
			
		||||
     attempting to work them out.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) If no SSLv2 ciphers are used don't use an SSLv2 compatible client hello:
 | 
			
		||||
     this allows the use of compression and extensions. Change default cipher
 | 
			
		||||
     string to remove SSLv2 ciphersuites. This effectively avoids ancient SSLv2
 | 
			
		||||
     by default unless an application cipher string requests it.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Alter match criteria in PKCS12_parse(). It used to try to use local
 | 
			
		||||
     key ids to find matching certificates and keys but some PKCS#12 files
 | 
			
		||||
     don't follow the (somewhat unwritten) rules and this strategy fails.
 | 
			
		||||
     Now just gather all certificates together and the first private key
 | 
			
		||||
     then look for the first certificate that matches the key.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Support use of registered digest and cipher names for dgst and cipher
 | 
			
		||||
     commands instead of having to add each one as a special case. So now
 | 
			
		||||
     you can do:
 | 
			
		||||
@@ -765,6 +814,46 @@
 | 
			
		||||
 | 
			
		||||
 Changes between 0.9.8k and 0.9.8l  [xx XXX xxxx]
 | 
			
		||||
 | 
			
		||||
  *) Add compression id to {d2i,i2d}_SSL_SESSION so it is correctly saved
 | 
			
		||||
     and restored.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Fix the server certificate chain building code to use X509_verify_cert(),
 | 
			
		||||
     it used to have an ad-hoc builder which was unable to cope with anything
 | 
			
		||||
     other than a simple chain.
 | 
			
		||||
     [David Woodhouse <dwmw2@infradead.org>, Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) Don't check self signed certificate signatures in X509_verify_cert()
 | 
			
		||||
     by default (a flag can override this): it just wastes time without
 | 
			
		||||
     adding any security. As a useful side effect self signed root CAs
 | 
			
		||||
     with non-FIPS digests are now usable in FIPS mode.
 | 
			
		||||
     [Steve Henson]
 | 
			
		||||
 | 
			
		||||
  *) In dtls1_process_out_of_seq_message() the check if the current message
 | 
			
		||||
     is already buffered was missing. For every new message was memory
 | 
			
		||||
     allocated, allowing an attacker to perform an denial of service attack
 | 
			
		||||
     with sending out of seq handshake messages until there is no memory
 | 
			
		||||
     left. Additionally every future messege was buffered, even if the
 | 
			
		||||
     sequence number made no sense and would be part of another handshake.
 | 
			
		||||
     So only messages with sequence numbers less than 10 in advance will be
 | 
			
		||||
     buffered.
 | 
			
		||||
     [Robin Seggelmann, discovered by Daniel Mentz] 	
 | 
			
		||||
 | 
			
		||||
  *) Records are buffered if they arrive with a future epoch to be
 | 
			
		||||
     processed after finishing the corresponding handshake. There is
 | 
			
		||||
     currently no limitation to this buffer allowing an attacker to perform
 | 
			
		||||
     a DOS attack with sending records with future epochs until there is no
 | 
			
		||||
     memory left. This patch adds the pqueue_size() function to detemine
 | 
			
		||||
     the size of a buffer and limits the record buffer to 100 entries.
 | 
			
		||||
     [Robin Seggelmann, discovered by Daniel Mentz] 	
 | 
			
		||||
 | 
			
		||||
  *) Keep a copy of frag->msg_header.frag_len so it can be used after the
 | 
			
		||||
     parent structure is freed.
 | 
			
		||||
     [Daniel Mentz] 	
 | 
			
		||||
 | 
			
		||||
  *) Handle non-blocking I/O properly in SSL_shutdown() call.
 | 
			
		||||
     [Darryl Miles <darryl-mailinglists@netbauds.net>]
 | 
			
		||||
 | 
			
		||||
  *) Add 2.5.4.* OIDs
 | 
			
		||||
     [Ilya O. <vrghost@gmail.com>]
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -148,7 +148,7 @@ eric (about to go bushwalking for the 4 day easter break :-)
 | 
			
		||||
      This would tend to cause memory overwrites since SSLv3 has
 | 
			
		||||
      a maximum packet size of 16k.  If your program uses
 | 
			
		||||
      buffers <= 16k, you would probably never see this problem.
 | 
			
		||||
    - Fixed a new errors that were cause by malloc() not returning
 | 
			
		||||
    - Fixed a few errors that were cause by malloc() not returning
 | 
			
		||||
      0 initialised memory..
 | 
			
		||||
    - SSL_OP_NETSCAPE_CA_DN_BUG was being switched on when using
 | 
			
		||||
      SSL_CTX_set_options(ssl_ctx,SSL_OP_ALL); which was a bad thing
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										54
									
								
								Configure
									
									
									
									
									
								
							
							
						
						
									
										54
									
								
								Configure
									
									
									
									
									
								
							@@ -164,7 +164,7 @@ my %table=(
 | 
			
		||||
"debug-ben",	"gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::bn86-elf.o co86-elf.o",
 | 
			
		||||
"debug-ben-openbsd","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
 | 
			
		||||
"debug-ben-openbsd-debug","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DOPENSSL_OPENBSD_DEV_CRYPTO -DOPENSSL_NO_ASM -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown)::::",
 | 
			
		||||
"debug-ben-debug",	"gcc:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DDEBUG_SAFESTACK -g3 -O2 -pipe::(unknown)::::::",
 | 
			
		||||
"debug-ben-debug",	"gcc:$gcc_devteam_warn -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -g3 -O2 -pipe::(unknown)::::::",
 | 
			
		||||
"debug-ben-no-opt",	"gcc: -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -DDEBUG_SAFESTACK -DCRYPTO_MDEBUG -Werror -DL_ENDIAN -DTERMIOS -Wall -g3::(unknown)::::::",
 | 
			
		||||
"debug-ben-strict",	"gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown)::::::",
 | 
			
		||||
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}",
 | 
			
		||||
@@ -191,8 +191,8 @@ my %table=(
 | 
			
		||||
"cc",		"cc:-O::(unknown)::::::",
 | 
			
		||||
 | 
			
		||||
####VOS Configurations
 | 
			
		||||
"vos-gcc","gcc:-O3 -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:",
 | 
			
		||||
"debug-vos-gcc","gcc:-O0 -g -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:",
 | 
			
		||||
"vos-gcc","gcc:-O3 -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:",
 | 
			
		||||
"debug-vos-gcc","gcc:-O0 -g -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG::(unknown):VOS:-Wl,-map:BN_LLONG:${no_asm}:::::.so:",
 | 
			
		||||
 | 
			
		||||
#### Solaris x86 with GNU C setups
 | 
			
		||||
# -DOPENSSL_NO_INLINE_ASM switches off inline assembler. We have to do it
 | 
			
		||||
@@ -400,7 +400,8 @@ my %table=(
 | 
			
		||||
 | 
			
		||||
# QNX
 | 
			
		||||
"qnx4",	"cc:-DL_ENDIAN -DTERMIO::(unknown):::${x86_gcc_des} ${x86_gcc_opts}:",
 | 
			
		||||
"qnx6",	"cc:-DL_ENDIAN -DTERMIOS::(unknown)::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:",
 | 
			
		||||
"QNX6",       "gcc:-DTERMIOS::::-lsocket::${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
"QNX6-i386",  "gcc:-DL_ENDIAN -DTERMIOS -O2 -Wall::::-lsocket:${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 | 
			
		||||
 | 
			
		||||
# BeOS
 | 
			
		||||
"beos-x86-r5",   "gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer -mcpu=pentium -Wall::-D_REENTRANT:BEOS:-lbe -lnet:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:beos:beos-shared:-fPIC -DPIC:-shared:.so",
 | 
			
		||||
@@ -485,18 +486,19 @@ my %table=(
 | 
			
		||||
#
 | 
			
		||||
# Win64 targets, WIN64I denotes IA-64 and WIN64A - AMD64
 | 
			
		||||
"VC-WIN64I","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64I::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:ia64cpuid.o:ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o:::::::ias:win32",
 | 
			
		||||
"VC-WIN64A","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:x86_64cpuid.o:bn_asm.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o::ml64:win32",
 | 
			
		||||
"VC-WIN64A","cl:-W3 -Gs0 -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_DEPRECATE:::WIN64A::SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:x86_64cpuid.o:bn_asm.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:auto:win32",
 | 
			
		||||
# x86 Win32 target defaults to ANSI API, if you want UNICODE, complement
 | 
			
		||||
# 'perl Configure VC-WIN32' with '-DUNICODE -D_UNICODE'
 | 
			
		||||
"VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
 | 
			
		||||
# Unified CE target
 | 
			
		||||
"debug-VC-WIN32","cl:-W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE:::WIN32::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${x86_asm}:win32n:win32",
 | 
			
		||||
"VC-CE","cl::::WINCE::BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN ${x86_gcc_opts}:${no_asm}:win32",
 | 
			
		||||
 | 
			
		||||
# Borland C++ 4.5
 | 
			
		||||
"BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32",
 | 
			
		||||
 | 
			
		||||
# MinGW
 | 
			
		||||
"mingw", "gcc:-mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall:::MINGW32:-lws2_32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
 | 
			
		||||
"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DOPENSSL_NO_CAPIENG -fomit-frame-pointer -O3 -march=i486 -Wall:::MINGW32:-lws2_32 -lgdi32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a",
 | 
			
		||||
# As for OPENSSL_USE_APPLINK. Applink makes it possible to use .dll
 | 
			
		||||
# compiled with one compiler with application compiled with another
 | 
			
		||||
# compiler. It's possible to engage Applink support in mingw64 build,
 | 
			
		||||
@@ -504,7 +506,7 @@ my %table=(
 | 
			
		||||
# handling, one can't seriously consider its binaries for using with
 | 
			
		||||
# non-mingw64 run-time environment. And as mingw64 is always consistent
 | 
			
		||||
# with itself, Applink is never engaged and can as well be omitted.
 | 
			
		||||
"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE:::MINGW64:-lws2_32 -lgdi32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a",
 | 
			
		||||
"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE:::MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a",
 | 
			
		||||
 | 
			
		||||
# UWIN 
 | 
			
		||||
"UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32",
 | 
			
		||||
@@ -569,11 +571,15 @@ my %table=(
 | 
			
		||||
##### Compaq Non-Stop Kernel (Tandem)
 | 
			
		||||
"tandem-c89","c89:-Ww -D__TANDEM -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1 -D_TANDEM_SOURCE -DB_ENDIAN::(unknown):::THIRTY_TWO_BIT:::",
 | 
			
		||||
 | 
			
		||||
# uClinux
 | 
			
		||||
"uClinux-dist","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):BN_LLONG:::::::::::::::$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
 | 
			
		||||
"uClinux-dist64","$ENV{'CC'}:\$(CFLAGS)::-D_REENTRANT::\$(LDFLAGS) \$(LDLIBS):SIXTY_FOUR_BIT_LONG:::::::::::::::$ENV{'LIBSSL_dlfcn'}:linux-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):$ENV{'RANLIB'}::",
 | 
			
		||||
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
my @MK1MF_Builds=qw(VC-WIN64I VC-WIN64A
 | 
			
		||||
		    VC-NT VC-CE VC-WIN32
 | 
			
		||||
		    BC-32 OS2-EMX
 | 
			
		||||
		    VC-NT VC-CE VC-WIN32 debug-VC-WIN32
 | 
			
		||||
		    BC-32 
 | 
			
		||||
		    netware-clib netware-clib-bsdsock
 | 
			
		||||
		    netware-libc netware-libc-bsdsock);
 | 
			
		||||
 | 
			
		||||
@@ -654,7 +660,8 @@ my $perl;
 | 
			
		||||
my %disabled = ( # "what"         => "comment" [or special keyword "experimental"]
 | 
			
		||||
		 "gmp"		  => "default",
 | 
			
		||||
                 "jpake"          => "experimental",
 | 
			
		||||
                 "mdc2"           => "default",
 | 
			
		||||
                 "md2"            => "default",
 | 
			
		||||
		 "mdc2"           => "default",
 | 
			
		||||
                 "rc5"            => "default",
 | 
			
		||||
		 "rfc3779"	  => "default",
 | 
			
		||||
                 "shared"         => "default",
 | 
			
		||||
@@ -666,8 +673,7 @@ my @experimental = ();
 | 
			
		||||
 | 
			
		||||
# This is what $depflags will look like with the above defaults
 | 
			
		||||
# (we need this to see if we should advise the user to run "make depend"):
 | 
			
		||||
my $default_depflags = " -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE";
 | 
			
		||||
 | 
			
		||||
my $default_depflags = " -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE";
 | 
			
		||||
 | 
			
		||||
# Explicit "no-..." options will be collected in %disabled along with the defaults.
 | 
			
		||||
# To remove something from %disabled, use "enable-foo" (unless it's experimental).
 | 
			
		||||
@@ -918,6 +924,12 @@ if (defined($disabled{"tls1"}))
 | 
			
		||||
	$disabled{"tlsext"} = "forced";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
if (defined($disabled{"ec"}) || defined($disabled{"dsa"})
 | 
			
		||||
    || defined($disabled{"dh"}))
 | 
			
		||||
	{
 | 
			
		||||
	$disabled{"gost"} = "forced";
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
if ($target eq "TABLE") {
 | 
			
		||||
	foreach $target (sort keys %table) {
 | 
			
		||||
		print_table_entry($target);
 | 
			
		||||
@@ -1218,7 +1230,14 @@ if ($zlib)
 | 
			
		||||
	$cflags = "-DZLIB $cflags";
 | 
			
		||||
	if (defined($disabled{"zlib-dynamic"}))
 | 
			
		||||
		{
 | 
			
		||||
		$lflags = "$lflags -lz";
 | 
			
		||||
		if (defined($withargs{"zlib-lib"}))
 | 
			
		||||
			{
 | 
			
		||||
			$lflags = "$lflags -L" . $withargs{"zlib-lib"} . " -lz";
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			$lflags = "$lflags -lz";
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
@@ -1425,6 +1444,7 @@ while (<IN>)
 | 
			
		||||
		}
 | 
			
		||||
	$sdirs = 0 unless /\\$/;
 | 
			
		||||
        s/engines // if (/^DIRS=/ && $disabled{"engine"});
 | 
			
		||||
	s/ccgost// if (/^ENGDIRS=/ && $disabled{"gost"});
 | 
			
		||||
	s/^VERSION=.*/VERSION=$version/;
 | 
			
		||||
	s/^MAJOR=.*/MAJOR=$major/;
 | 
			
		||||
	s/^MINOR=.*/MINOR=$minor/;
 | 
			
		||||
@@ -1970,23 +1990,23 @@ sub test_sanity
 | 
			
		||||
		{
 | 
			
		||||
		@fields = split(/\s*:\s*/,$table{$target} . ":" x 30 , -1);
 | 
			
		||||
 | 
			
		||||
		if ($fields[$idx_dso_scheme-1] =~ /^(dl|dlfcn|win32|vms)$/)
 | 
			
		||||
		if ($fields[$idx_dso_scheme-1] =~ /^(beos|dl|dlfcn|win32|vms)$/)
 | 
			
		||||
			{
 | 
			
		||||
			$errorcnt++;
 | 
			
		||||
			print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
 | 
			
		||||
			print STDERR "              in the previous field\n";
 | 
			
		||||
			}
 | 
			
		||||
		elsif ($fields[$idx_dso_scheme+1] =~ /^(dl|dlfcn|win32|vms)$/)
 | 
			
		||||
		elsif ($fields[$idx_dso_scheme+1] =~ /^(beos|dl|dlfcn|win32|vms)$/)
 | 
			
		||||
			{
 | 
			
		||||
			$errorcnt++;
 | 
			
		||||
			print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] values\n";
 | 
			
		||||
			print STDERR "              in the following field\n";
 | 
			
		||||
			}
 | 
			
		||||
		elsif ($fields[$idx_dso_scheme] !~ /^(dl|dlfcn|win32|vms|)$/)
 | 
			
		||||
		elsif ($fields[$idx_dso_scheme] !~ /^(beos|dl|dlfcn|win32|vms|)$/)
 | 
			
		||||
			{
 | 
			
		||||
			$errorcnt++;
 | 
			
		||||
			print STDERR "SANITY ERROR: '$target' has the dso_scheme [$idx_dso_scheme] field = ",$fields[$idx_dso_scheme],"\n";
 | 
			
		||||
			print STDERR "              valid values are 'dl', 'dlfcn', 'win32' and 'vms'\n";
 | 
			
		||||
			print STDERR "              valid values are 'beos', 'dl', 'dlfcn', 'win32' and 'vms'\n";
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	print STDERR "No sanity errors detected!\n" if $errorcnt == 0;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								INSTALL
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								INSTALL
									
									
									
									
									
								
							@@ -103,6 +103,12 @@
 | 
			
		||||
                define preprocessor symbols, specify additional libraries,
 | 
			
		||||
                library directories or other compiler options.
 | 
			
		||||
 | 
			
		||||
  -DHAVE_CRYPTODEV Enable the BSD cryptodev engine even if we are not using
 | 
			
		||||
		BSD. Useful if you are running ocf-linux or something
 | 
			
		||||
		similar. Once enabled you can also enable the use of
 | 
			
		||||
		cryptodev digests, which is usually slower unless you have
 | 
			
		||||
		large amounts data. Use -DUSE_CRYPTODEV_DIGESTS to force
 | 
			
		||||
		it.
 | 
			
		||||
 | 
			
		||||
 Installation in Detail
 | 
			
		||||
 ----------------------
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										21
									
								
								INSTALL.W32
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								INSTALL.W32
									
									
									
									
									
								
							@@ -27,7 +27,7 @@
 | 
			
		||||
 | 
			
		||||
- Netwide Assembler, a.k.a. NASM, available from http://nasm.sourceforge.net/
 | 
			
		||||
  is required if you intend to utilize assembler modules. Note that NASM
 | 
			
		||||
  is the only supported assembler.
 | 
			
		||||
  is now the only supported assembler.
 | 
			
		||||
 | 
			
		||||
 If you are compiling from a tarball or a CVS snapshot then the Win32 files
 | 
			
		||||
 may well be not up to date. This may mean that some "tweaking" is required to
 | 
			
		||||
@@ -41,9 +41,9 @@
 | 
			
		||||
 C++, then you will need already mentioned Netwide Assembler binary,
 | 
			
		||||
 nasmw.exe or nasm.exe, to be available on your %PATH%.
 | 
			
		||||
 | 
			
		||||
 Firstly you should run Configure:
 | 
			
		||||
 Firstly you should run Configure with platform VC-WIN32:
 | 
			
		||||
 | 
			
		||||
 > perl Configure VC-WIN32 --prefix=c:/some/openssl/dir
 | 
			
		||||
 > perl Configure VC-WIN32 --prefix=c:\some\openssl\dir
 | 
			
		||||
 | 
			
		||||
 Where the prefix argument specifies where OpenSSL will be installed to.
 | 
			
		||||
 | 
			
		||||
@@ -56,6 +56,7 @@
 | 
			
		||||
 | 
			
		||||
 - If you don't want to use the assembly language files at all then run:
 | 
			
		||||
 | 
			
		||||
   > perl Configure VC-WIN32 no-asm --prefix=c:/some/openssl/dir
 | 
			
		||||
   > ms\do_ms
 | 
			
		||||
 | 
			
		||||
 If you get errors about things not having numbers assigned then check the
 | 
			
		||||
@@ -80,16 +81,13 @@
 | 
			
		||||
 | 
			
		||||
 There are various changes you can make to the Win32 compile
 | 
			
		||||
 environment. By default the library is not compiled with debugging
 | 
			
		||||
 symbols. If you add 'debug' to the mk1mf.pl lines in the do_* batch
 | 
			
		||||
 file then debugging symbols will be compiled in. Note that mk1mf.pl
 | 
			
		||||
 expects the platform to be the last argument on the command line, so
 | 
			
		||||
 'debug' must appear before that, as all other options.
 | 
			
		||||
 symbols. If you use the platform debug-VC-WIN32 instead of VC-WIN32
 | 
			
		||||
 then debugging symbols will be compiled in.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 By default in 0.9.8 OpenSSL will compile builtin ENGINES into the
 | 
			
		||||
 libeay32.dll shared library. If you specify the "no-static-engine"
 | 
			
		||||
 By default in 1.0.0 OpenSSL will compile builtin ENGINES into the
 | 
			
		||||
 separate shared librariesy. If you specify the "enable-static-engine"
 | 
			
		||||
 option on the command line to Configure the shared library build
 | 
			
		||||
 (ms\ntdll.mak) will compile the engines as separate DLLs.
 | 
			
		||||
 (ms\ntdll.mak) will compile the engines into libeay32.dll instead.
 | 
			
		||||
 | 
			
		||||
 The default Win32 environment is to leave out any Windows NT specific
 | 
			
		||||
 features.
 | 
			
		||||
@@ -102,7 +100,6 @@
 | 
			
		||||
 ms\nt.mak
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 Borland C++ builder 5
 | 
			
		||||
 ---------------------
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										14
									
								
								Makefile.org
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								Makefile.org
									
									
									
									
									
								
							@@ -109,6 +109,7 @@ ZLIB_INCLUDE=
 | 
			
		||||
LIBZLIB=
 | 
			
		||||
 | 
			
		||||
DIRS=   crypto ssl engines apps test tools
 | 
			
		||||
ENGDIRS= ccgost
 | 
			
		||||
SHLIBDIRS= crypto ssl
 | 
			
		||||
 | 
			
		||||
# dirs in crypto to build
 | 
			
		||||
@@ -179,7 +180,7 @@ BUILDENV=	PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
 | 
			
		||||
		AS='$(CC)' ASFLAG='$(CFLAG) -c'			\
 | 
			
		||||
		AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)'	\
 | 
			
		||||
		CROSS_COMPILE_PREFIX='$(CROSS_COMPILE_PREFIX)'	\
 | 
			
		||||
		PERL='$(PERL)'					\
 | 
			
		||||
		PERL='$(PERL)' ENGDIRS='$(ENGDIRS)'		\
 | 
			
		||||
		SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/lib'	\
 | 
			
		||||
		INSTALL_PREFIX='$(INSTALL_PREFIX)'		\
 | 
			
		||||
		INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)'	\
 | 
			
		||||
@@ -188,6 +189,7 @@ BUILDENV=	PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
 | 
			
		||||
		MAKEDEPPROG='$(MAKEDEPPROG)'			\
 | 
			
		||||
		SHARED_LDFLAGS='$(SHARED_LDFLAGS)'		\
 | 
			
		||||
		KRB5_INCLUDES='$(KRB5_INCLUDES)' LIBKRB5='$(LIBKRB5)'	\
 | 
			
		||||
		ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)'	\
 | 
			
		||||
		EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)'	\
 | 
			
		||||
		SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)'	\
 | 
			
		||||
		PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)'	\
 | 
			
		||||
@@ -403,8 +405,8 @@ test:   tests
 | 
			
		||||
 | 
			
		||||
tests: rehash
 | 
			
		||||
	@(cd test && echo "testing..." && \
 | 
			
		||||
	$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on tests );
 | 
			
		||||
	util/opensslwrap.sh version -a
 | 
			
		||||
	$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
 | 
			
		||||
	OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
 | 
			
		||||
 | 
			
		||||
report:
 | 
			
		||||
	@$(PERL) util/selftest.pl
 | 
			
		||||
@@ -579,7 +581,7 @@ install_html_docs:
 | 
			
		||||
				grep -v $$filecase "^$$fn\$$" | \
 | 
			
		||||
				(cd $(INSTALL_PREFIX)$(HTMLDIR)/$$subdir; \
 | 
			
		||||
				 while read n; do \
 | 
			
		||||
					$$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
 | 
			
		||||
					PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \
 | 
			
		||||
				 done); \
 | 
			
		||||
		done; \
 | 
			
		||||
	done
 | 
			
		||||
@@ -610,7 +612,7 @@ install_docs:
 | 
			
		||||
			(grep -v "[	]"; true) | \
 | 
			
		||||
			(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
 | 
			
		||||
			 while read n; do \
 | 
			
		||||
				$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
 | 
			
		||||
				PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
 | 
			
		||||
			 done); \
 | 
			
		||||
	done; \
 | 
			
		||||
	set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
 | 
			
		||||
@@ -627,7 +629,7 @@ install_docs:
 | 
			
		||||
			(grep -v "[	]"; true) | \
 | 
			
		||||
			(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
 | 
			
		||||
			 while read n; do \
 | 
			
		||||
				$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
 | 
			
		||||
				PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
 | 
			
		||||
			 done); \
 | 
			
		||||
	done
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								NEWS
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								NEWS
									
									
									
									
									
								
							@@ -11,7 +11,7 @@
 | 
			
		||||
      o RFC3280 path validation: sufficient to process PKITS tests.
 | 
			
		||||
      o Integrated support for PVK files and keyblobs.
 | 
			
		||||
      o Change default private key format to PKCS#8.
 | 
			
		||||
      o CMS support: able to process all examples in RFCXXXX
 | 
			
		||||
      o CMS support: able to process all examples in RFC4134
 | 
			
		||||
      o Streaming ASN1 encode support for PKCS#7 and CMS.
 | 
			
		||||
      o Multiple signer and signer add support for PKCS#7 and CMS.
 | 
			
		||||
      o ASN1 printing support.
 | 
			
		||||
@@ -27,6 +27,7 @@
 | 
			
		||||
      o ecdsa-with-SHA224/256/384/512 signature types.
 | 
			
		||||
      o dsa-with-SHA224 and dsa-with-SHA256 signature types.
 | 
			
		||||
      o Opaque PRF Input TLS extension support.
 | 
			
		||||
      o Updated time routines to avoid OS limitations.
 | 
			
		||||
 | 
			
		||||
  Major changes between OpenSSL 0.9.8j and OpenSSL 0.9.8k:
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								README
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								README
									
									
									
									
									
								
							@@ -1,5 +1,5 @@
 | 
			
		||||
 | 
			
		||||
 OpenSSL 1.0.0-dev XX xxx XXXX
 | 
			
		||||
 OpenSSL 1.0.0-beta3 15 Jul 2009
 | 
			
		||||
 | 
			
		||||
 Copyright (c) 1998-2008 The OpenSSL Project
 | 
			
		||||
 Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								STATUS
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								STATUS
									
									
									
									
									
								
							@@ -1,10 +1,12 @@
 | 
			
		||||
 | 
			
		||||
  OpenSSL STATUS                           Last modified at
 | 
			
		||||
  ______________                           $Date: 2009/03/30 11:33:03 $
 | 
			
		||||
  ______________                           $Date: 2009/07/15 11:37:45 $
 | 
			
		||||
 | 
			
		||||
  DEVELOPMENT STATE
 | 
			
		||||
 | 
			
		||||
    o  OpenSSL 1.0:  Under development...
 | 
			
		||||
    o  OpenSSL 1.0.0-beta3: Released on July 15th, 2009
 | 
			
		||||
    o  OpenSSL 1.0.0-beta2: Released on April 21st, 2009
 | 
			
		||||
    o  OpenSSL 1.0.0-beta1: Released on April 1st, 2009
 | 
			
		||||
    o  OpenSSL 0.9.8h: Released on May       28th, 2008
 | 
			
		||||
    o  OpenSSL 0.9.8g: Released on October   19th, 2007
 | 
			
		||||
    o  OpenSSL 0.9.8f: Released on October   11th, 2007
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										200
									
								
								TABLE
									
									
									
									
									
								
							
							
						
						
									
										200
									
								
								TABLE
									
									
									
									
									
								
							@@ -496,6 +496,68 @@ $ranlib       =
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** QNX6
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DTERMIOS
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = 
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
$lflags       = -lsocket
 | 
			
		||||
$bn_ops       = 
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$wp_obj       = 
 | 
			
		||||
$cmll_obj     = 
 | 
			
		||||
$perlasm_scheme = void
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= bsd-gcc-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** QNX6-i386
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIOS -O2 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = 
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
$lflags       = -lsocket
 | 
			
		||||
$bn_ops       = DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
 | 
			
		||||
$cpuid_obj    = x86cpuid.o
 | 
			
		||||
$bn_obj       = bn-586.o co-586.o x86-mont.o
 | 
			
		||||
$des_obj      = des-586.o crypt586.o
 | 
			
		||||
$aes_obj      = aes-586.o
 | 
			
		||||
$bf_obj       = bf-586.o
 | 
			
		||||
$md5_obj      = md5-586.o
 | 
			
		||||
$sha1_obj     = sha1-586.o sha256-586.o sha512-586.o
 | 
			
		||||
$cast_obj     = cast-586.o
 | 
			
		||||
$rc4_obj      = rc4-586.o
 | 
			
		||||
$rmd160_obj   = rmd-586.o
 | 
			
		||||
$rc5_obj      = rc5-586.o
 | 
			
		||||
$wp_obj       = wp_block.o wp-mmx.o
 | 
			
		||||
$cmll_obj     = cmll-x86.o
 | 
			
		||||
$perlasm_scheme = elf
 | 
			
		||||
$dso_scheme   = dlfcn
 | 
			
		||||
$shared_target= bsd-gcc-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** ReliantUNIX
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -KPIC -g -DTERMIOS -DB_ENDIAN
 | 
			
		||||
@@ -702,8 +764,8 @@ $rc4_obj      = rc4-x86_64.o
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$wp_obj       = wp-x86_64.o
 | 
			
		||||
$cmll_obj     = 
 | 
			
		||||
$perlasm_scheme = ml64
 | 
			
		||||
$cmll_obj     = cmll-x86_64.o cmll_misc.o
 | 
			
		||||
$perlasm_scheme = auto
 | 
			
		||||
$dso_scheme   = win32
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
@@ -1333,6 +1395,37 @@ $ranlib       =
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** debug-VC-WIN32
 | 
			
		||||
$cc           = cl
 | 
			
		||||
$cflags       = -W3 -WX -Gs0 -GF -Gy -Zi -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = 
 | 
			
		||||
$sys_id       = WIN32
 | 
			
		||||
$lflags       = 
 | 
			
		||||
$bn_ops       = BN_LLONG RC4_INDEX EXPORT_VAR_AS_FN RC4_INDEX MD2_INT
 | 
			
		||||
$cpuid_obj    = x86cpuid.o
 | 
			
		||||
$bn_obj       = bn-586.o co-586.o x86-mont.o
 | 
			
		||||
$des_obj      = des-586.o crypt586.o
 | 
			
		||||
$aes_obj      = aes-586.o
 | 
			
		||||
$bf_obj       = bf-586.o
 | 
			
		||||
$md5_obj      = md5-586.o
 | 
			
		||||
$sha1_obj     = sha1-586.o sha256-586.o sha512-586.o
 | 
			
		||||
$cast_obj     = cast-586.o
 | 
			
		||||
$rc4_obj      = rc4-586.o
 | 
			
		||||
$rmd160_obj   = rmd-586.o
 | 
			
		||||
$rc5_obj      = rc5-586.o
 | 
			
		||||
$wp_obj       = wp_block.o wp-mmx.o
 | 
			
		||||
$cmll_obj     = cmll-x86.o
 | 
			
		||||
$perlasm_scheme = win32n
 | 
			
		||||
$dso_scheme   = win32
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** debug-ben
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -O2 -pedantic -Wall -Wshadow -Werror -pipe
 | 
			
		||||
@@ -1366,7 +1459,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-ben-debug
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG -DPEDANTIC -DDEBUG_SAFESTACK -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe
 | 
			
		||||
$cflags       = -Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DOPENSSL_NO_DEPRECATED -DBN_DEBUG -DCONF_DEBUG -DDEBUG_SAFESTACK -g3 -O2 -pipe
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
@@ -2234,7 +2327,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** debug-vos-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O0 -g -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG
 | 
			
		||||
$cflags       = -O0 -g -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN -DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = VOS
 | 
			
		||||
@@ -3691,7 +3784,7 @@ $multilib     = 64
 | 
			
		||||
 | 
			
		||||
*** mingw
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -mno-cygwin -DL_ENDIAN -fomit-frame-pointer -O3 -march=i486 -Wall
 | 
			
		||||
$cflags       = -mno-cygwin -DL_ENDIAN -DOPENSSL_NO_CAPIENG -fomit-frame-pointer -O3 -march=i486 -Wall
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = 
 | 
			
		||||
$sys_id       = MINGW32
 | 
			
		||||
@@ -3726,7 +3819,7 @@ $cflags       = -mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = 
 | 
			
		||||
$sys_id       = MINGW64
 | 
			
		||||
$lflags       = -lws2_32 -lgdi32
 | 
			
		||||
$lflags       = -lws2_32 -lgdi32 -lcrypt32
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN
 | 
			
		||||
$cpuid_obj    = x86_64cpuid.o
 | 
			
		||||
$bn_obj       = x86_64-gcc.o x86_64-mont.o
 | 
			
		||||
@@ -4247,37 +4340,6 @@ $ranlib       =
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** qnx6
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -DL_ENDIAN -DTERMIOS
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
$lflags       = -lsocket
 | 
			
		||||
$bn_ops       = DES_PTR DES_RISC1 DES_UNROLL RC4_INDEX MD2_INT
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$wp_obj       = 
 | 
			
		||||
$cmll_obj     = 
 | 
			
		||||
$perlasm_scheme = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= 
 | 
			
		||||
$shared_cflag = 
 | 
			
		||||
$shared_ldflag = 
 | 
			
		||||
$shared_extension = 
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** rhapsody-ppc-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -O3 -DB_ENDIAN
 | 
			
		||||
@@ -4836,6 +4898,68 @@ $ranlib       =
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** uClinux-dist
 | 
			
		||||
$cc           = 
 | 
			
		||||
$cflags       = $(CFLAGS)
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
$lflags       = $(LDFLAGS) $(LDLIBS)
 | 
			
		||||
$bn_ops       = BN_LLONG
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$wp_obj       = 
 | 
			
		||||
$cmll_obj     = 
 | 
			
		||||
$perlasm_scheme = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= linux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_ldflag = -shared
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** uClinux-dist64
 | 
			
		||||
$cc           = 
 | 
			
		||||
$cflags       = $(CFLAGS)
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = -D_REENTRANT
 | 
			
		||||
$sys_id       = 
 | 
			
		||||
$lflags       = $(LDFLAGS) $(LDLIBS)
 | 
			
		||||
$bn_ops       = SIXTY_FOUR_BIT_LONG
 | 
			
		||||
$cpuid_obj    = 
 | 
			
		||||
$bn_obj       = 
 | 
			
		||||
$des_obj      = 
 | 
			
		||||
$aes_obj      = 
 | 
			
		||||
$bf_obj       = 
 | 
			
		||||
$md5_obj      = 
 | 
			
		||||
$sha1_obj     = 
 | 
			
		||||
$cast_obj     = 
 | 
			
		||||
$rc4_obj      = 
 | 
			
		||||
$rmd160_obj   = 
 | 
			
		||||
$rc5_obj      = 
 | 
			
		||||
$wp_obj       = 
 | 
			
		||||
$cmll_obj     = 
 | 
			
		||||
$perlasm_scheme = 
 | 
			
		||||
$dso_scheme   = 
 | 
			
		||||
$shared_target= linux-shared
 | 
			
		||||
$shared_cflag = -fPIC
 | 
			
		||||
$shared_ldflag = -shared
 | 
			
		||||
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
 | 
			
		||||
$ranlib       = 
 | 
			
		||||
$arflags      = 
 | 
			
		||||
$multilib     = 
 | 
			
		||||
 | 
			
		||||
*** ultrix-cc
 | 
			
		||||
$cc           = cc
 | 
			
		||||
$cflags       = -std1 -O -Olimit 2500 -DL_ENDIAN
 | 
			
		||||
@@ -5024,7 +5148,7 @@ $multilib     =
 | 
			
		||||
 | 
			
		||||
*** vos-gcc
 | 
			
		||||
$cc           = gcc
 | 
			
		||||
$cflags       = -O3 -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -DB_ENDIAN
 | 
			
		||||
$cflags       = -O3 -Wall -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN
 | 
			
		||||
$unistd       = 
 | 
			
		||||
$thread_cflag = (unknown)
 | 
			
		||||
$sys_id       = VOS
 | 
			
		||||
 
 | 
			
		||||
@@ -12,6 +12,14 @@ $	    WRITE SYS$OUTPUT "Should be the directory where you want things installed.
 | 
			
		||||
$	    EXIT
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$
 | 
			
		||||
$	IF (F$GETSYI("CPU").LT.128)
 | 
			
		||||
$	THEN
 | 
			
		||||
$	    ARCH := VAX
 | 
			
		||||
$	ELSE
 | 
			
		||||
$	    ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
 | 
			
		||||
$	    IF (ARCH .EQS. "") THEN ARCH = "UNK"
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$
 | 
			
		||||
$	ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0"
 | 
			
		||||
$	ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY")
 | 
			
		||||
$	ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
 | 
			
		||||
@@ -19,13 +27,7 @@ $	ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
 | 
			
		||||
$	ROOT = ROOT_DEV + "[" + ROOT_DIR
 | 
			
		||||
$
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLVLIB WRK_SSLROOT:[VAX_LIB]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLALIB WRK_SSLROOT:[ALPHA_LIB]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLINCLUDE WRK_SSLROOT:[INCLUDE]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLVEXE WRK_SSLROOT:[VAX_EXE]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLAEXE WRK_SSLROOT:[ALPHA_EXE]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLCERTS WRK_SSLROOT:[CERTS]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLPRIVATE WRK_SSLROOT:[PRIVATE]
 | 
			
		||||
$
 | 
			
		||||
$	IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN -
 | 
			
		||||
	   CREATE/DIR/LOG WRK_SSLROOT:[000000]
 | 
			
		||||
@@ -39,7 +41,7 @@ $	IF F$SEARCH("WRK_SSLINCLUDE:vms_idhacks.h") .NES. "" THEN -
 | 
			
		||||
$
 | 
			
		||||
$	OPEN/WRITE SF WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM
 | 
			
		||||
$	WRITE SYS$OUTPUT "%OPEN-I-CREATED,  ",F$SEARCH("WRK_SSLROOT:[VMS]OPENSSL_STARTUP.COM")," created."
 | 
			
		||||
$	WRITE SF "$! Startup file for Openssl 0.9.2-RL 15-Mar-1999"
 | 
			
		||||
$	WRITE SF "$! Startup file for Openssl"
 | 
			
		||||
$	WRITE SF "$!"
 | 
			
		||||
$	WRITE SF "$! Do not edit this file, as it will be regenerated during next installation."
 | 
			
		||||
$	WRITE SF "$! Instead, add or change SSLROOT:[VMS]OPENSSL_SYSTARTUP.COM"
 | 
			
		||||
@@ -47,8 +49,13 @@ $	WRITE SF "$!"
 | 
			
		||||
$	WRITE SF "$! P1	a qualifier to DEFINE.  For example ""/SYSTEM"" to get the logical names"
 | 
			
		||||
$	WRITE SF "$!	defined in the system logical name table."
 | 
			
		||||
$	WRITE SF "$!"
 | 
			
		||||
$	WRITE SF "$	ARCH = ""VAX"""
 | 
			
		||||
$	WRITE SF "$	IF F$GETSYI(""CPU"") .GE. 128 THEN ARCH = ""ALPHA"""
 | 
			
		||||
$	WRITE SF "$	IF (F$GETSYI(""CPU"").LT.128)"
 | 
			
		||||
$	WRITE SF "$	THEN"
 | 
			
		||||
$	WRITE SF "$	    ARCH := VAX"
 | 
			
		||||
$	WRITE SF "$	ELSE"
 | 
			
		||||
$	WRITE SF "$	    ARCH = F$EDIT( F$GETSYI( ""ARCH_NAME""), ""UPCASE"")"
 | 
			
		||||
$	WRITE SF "$	    IF (ARCH .EQS. """") THEN ARCH = ""UNK"""
 | 
			
		||||
$	WRITE SF "$	ENDIF"
 | 
			
		||||
$	WRITE SF "$	DEFINE/NOLOG'P1	SSLROOT		",ROOT,".] /TRANS=CONC"
 | 
			
		||||
$	WRITE SF "$	DEFINE/NOLOG'P1	SSLLIB		SSLROOT:['ARCH'_LIB]"
 | 
			
		||||
$	WRITE SF "$	DEFINE/NOLOG'P1	SSLINCLUDE	SSLROOT:[INCLUDE]"
 | 
			
		||||
 
 | 
			
		||||
@@ -3,10 +3,10 @@ $!
 | 
			
		||||
$! No command line parameters.  This should be run at the start of the source
 | 
			
		||||
$! tree (the same directory where one finds INSTALL.VMS).
 | 
			
		||||
$!
 | 
			
		||||
$! Input:	[.UTIL]LIBEAY.NUM,[.AXP.EXE.CRYPTO]LIBCRYPTO.OLB
 | 
			
		||||
$!		[.UTIL]SSLEAY.NUM,[.AXP.EXE.SSL]LIBSSL.OLB
 | 
			
		||||
$! Output:	[.AXP.EXE.CRYPTO]LIBCRYPTO.OPT,.MAP,.EXE
 | 
			
		||||
$!		[.AXP.EXE.SSL]LIBSSL.OPT,.MAP,.EXE
 | 
			
		||||
$! Input:	[.UTIL]LIBEAY.NUM,[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB
 | 
			
		||||
$!		[.UTIL]SSLEAY.NUM,[.xxx.EXE.SSL]LIBSSL.OLB
 | 
			
		||||
$! Output:	[.xxx.EXE.CRYPTO]LIBCRYPTO.OPT,.MAP,.EXE
 | 
			
		||||
$!		[.xxx.EXE.SSL]LIBSSL.OPT,.MAP,.EXE
 | 
			
		||||
$!
 | 
			
		||||
$! So far, tests have only been made on VMS for Alpha.  VAX will come in time.
 | 
			
		||||
$! ===========================================================================
 | 
			
		||||
@@ -19,31 +19,41 @@ $   write sys$error "ERROR: Couldn't find any library version info..."
 | 
			
		||||
$   exit
 | 
			
		||||
$ endif
 | 
			
		||||
$
 | 
			
		||||
$ if f$getsyi("CPU") .ge. 128
 | 
			
		||||
$ if (f$getsyi("cpu").lt.128)
 | 
			
		||||
$ then
 | 
			
		||||
$     arch := VAX
 | 
			
		||||
$ else
 | 
			
		||||
$     arch = f$edit( f$getsyi( "ARCH_NAME"), "UPCASE")
 | 
			
		||||
$     if (arch .eqs. "") then arch = "UNK"
 | 
			
		||||
$ endif
 | 
			
		||||
$
 | 
			
		||||
$ if arch .nes. "VAX"
 | 
			
		||||
$ then
 | 
			
		||||
$   arch_vax = 0
 | 
			
		||||
$   libid  = "Crypto"
 | 
			
		||||
$   libnum = "[.UTIL]LIBEAY.NUM"
 | 
			
		||||
$   libdir = "[.AXP.EXE.CRYPTO]"
 | 
			
		||||
$   libdir = "[.''ARCH'.EXE.CRYPTO]"
 | 
			
		||||
$   libolb = "''libdir'LIBCRYPTO.OLB"
 | 
			
		||||
$   libopt = "''libdir'LIBCRYPTO.OPT"
 | 
			
		||||
$   libmap = "''libdir'LIBCRYPTO.MAP"
 | 
			
		||||
$   libgoal= "''libdir'LIBCRYPTO.EXE"
 | 
			
		||||
$   libref = ""
 | 
			
		||||
$   gosub create_axp_shr
 | 
			
		||||
$   gosub create_nonvax_shr
 | 
			
		||||
$   libid  = "SSL"
 | 
			
		||||
$   libnum = "[.UTIL]SSLEAY.NUM"
 | 
			
		||||
$   libdir = "[.AXP.EXE.SSL]"
 | 
			
		||||
$   libdir = "[.''ARCH'.EXE.SSL]"
 | 
			
		||||
$   libolb = "''libdir'LIBSSL.OLB"
 | 
			
		||||
$   libopt = "''libdir'LIBSSL.OPT"
 | 
			
		||||
$   libmap = "''libdir'LIBSSL.MAP"
 | 
			
		||||
$   libgoal= "''libdir'LIBSSL.EXE"
 | 
			
		||||
$   libref = "[.AXP.EXE.CRYPTO]LIBCRYPTO.EXE"
 | 
			
		||||
$   gosub create_axp_shr
 | 
			
		||||
$   libref = "[.''ARCH'.EXE.CRYPTO]LIBCRYPTO.EXE"
 | 
			
		||||
$   gosub create_nonvax_shr
 | 
			
		||||
$ else
 | 
			
		||||
$   arch_vax = 1
 | 
			
		||||
$   libtit = "CRYPTO_TRANSFER_VECTOR"
 | 
			
		||||
$   libid  = "Crypto"
 | 
			
		||||
$   libnum = "[.UTIL]LIBEAY.NUM"
 | 
			
		||||
$   libdir = "[.VAX.EXE.CRYPTO]"
 | 
			
		||||
$   libdir = "[.''ARCH'.EXE.CRYPTO]"
 | 
			
		||||
$   libmar = "''libdir'LIBCRYPTO.MAR"
 | 
			
		||||
$   libolb = "''libdir'LIBCRYPTO.OLB"
 | 
			
		||||
$   libopt = "''libdir'LIBCRYPTO.OPT"
 | 
			
		||||
@@ -56,22 +66,22 @@ $   gosub create_vax_shr
 | 
			
		||||
$   libtit = "SSL_TRANSFER_VECTOR"
 | 
			
		||||
$   libid  = "SSL"
 | 
			
		||||
$   libnum = "[.UTIL]SSLEAY.NUM"
 | 
			
		||||
$   libdir = "[.VAX.EXE.SSL]"
 | 
			
		||||
$   libdir = "[.''ARCH'.EXE.SSL]"
 | 
			
		||||
$   libmar = "''libdir'LIBSSL.MAR"
 | 
			
		||||
$   libolb = "''libdir'LIBSSL.OLB"
 | 
			
		||||
$   libopt = "''libdir'LIBSSL.OPT"
 | 
			
		||||
$   libobj = "''libdir'LIBSSL.OBJ"
 | 
			
		||||
$   libmap = "''libdir'LIBSSL.MAP"
 | 
			
		||||
$   libgoal= "''libdir'LIBSSL.EXE"
 | 
			
		||||
$   libref = "[.VAX.EXE.CRYPTO]LIBCRYPTO.EXE"
 | 
			
		||||
$   libref = "[.''ARCH'.EXE.CRYPTO]LIBCRYPTO.EXE"
 | 
			
		||||
$   libvec = "LIBSSL"
 | 
			
		||||
$   gosub create_vax_shr
 | 
			
		||||
$ endif
 | 
			
		||||
$ exit
 | 
			
		||||
$
 | 
			
		||||
$! ----- Soubroutines to actually build the shareable libraries
 | 
			
		||||
$! The way things work, there's a main shareable library creator for each
 | 
			
		||||
$! supported architecture, which is called from the main code above.
 | 
			
		||||
$! ----- Soubroutines to build the shareable libraries
 | 
			
		||||
$! For each supported architecture, there's a main shareable library
 | 
			
		||||
$! creator, which is called from the main code above.
 | 
			
		||||
$! The creator will define a number of variables to tell the next levels of
 | 
			
		||||
$! subroutines what routines to use to write to the option files, call the
 | 
			
		||||
$! main processor, read_func_num, and when that is done, it will write version
 | 
			
		||||
@@ -97,10 +107,10 @@ $! read_func_num depends on the following variables from the creator:
 | 
			
		||||
$! libwriter	The name of the writer routine to call for each .num file line
 | 
			
		||||
$! -----
 | 
			
		||||
$
 | 
			
		||||
$! ----- Subroutines for AXP
 | 
			
		||||
$! ----- Subroutines for non-VAX
 | 
			
		||||
$! -----
 | 
			
		||||
$! The creator routine
 | 
			
		||||
$ create_axp_shr:
 | 
			
		||||
$ create_nonvax_shr:
 | 
			
		||||
$   open/write opt 'libopt'
 | 
			
		||||
$   write opt "identification=""",libid," ",libverstr,""""
 | 
			
		||||
$   write opt libolb,"/lib"
 | 
			
		||||
@@ -108,7 +118,7 @@ $   if libref .nes. "" then write opt libref,"/SHARE"
 | 
			
		||||
$   write opt "SYMBOL_VECTOR=(-"
 | 
			
		||||
$   libfirstentry := true
 | 
			
		||||
$   libwrch   := opt
 | 
			
		||||
$   libwriter := write_axp_transfer_entry
 | 
			
		||||
$   libwriter := write_nonvax_transfer_entry
 | 
			
		||||
$   textcount = 0
 | 
			
		||||
$   gosub read_func_num
 | 
			
		||||
$   write opt ")"
 | 
			
		||||
@@ -118,7 +128,7 @@ $   link/map='libmap'/full/share='libgoal' 'libopt'/option
 | 
			
		||||
$   return
 | 
			
		||||
$
 | 
			
		||||
$! The record writer routine
 | 
			
		||||
$ write_axp_transfer_entry:
 | 
			
		||||
$ write_nonvax_transfer_entry:
 | 
			
		||||
$   if libentry .eqs. ".dummy" then return
 | 
			
		||||
$   if info_kind .eqs. "VARIABLE"
 | 
			
		||||
$   then
 | 
			
		||||
@@ -144,7 +154,7 @@ $   libfirstentry := false
 | 
			
		||||
$   textcount = textcount + textcount_this
 | 
			
		||||
$   return
 | 
			
		||||
$
 | 
			
		||||
$! ----- Subroutines for AXP
 | 
			
		||||
$! ----- Subroutines for VAX
 | 
			
		||||
$! -----
 | 
			
		||||
$! The creator routine
 | 
			
		||||
$ create_vax_shr:
 | 
			
		||||
@@ -264,8 +274,15 @@ $             truesum = truesum + 1
 | 
			
		||||
$           if plat_entry .eqs. "!EXPORT_VAR_AS_FUNCTION" then -
 | 
			
		||||
$             falsesum = falsesum + 1
 | 
			
		||||
$         endif
 | 
			
		||||
$         if plat_entry .eqs. "VMS" then truesum = truesum + 1
 | 
			
		||||
$         if plat_entry .eqs. "!VMS" then falsesum = falsesum + 1
 | 
			
		||||
$!
 | 
			
		||||
$         if ((plat_entry .eqs. "VMS") .or. -
 | 
			
		||||
            (arch_vax .and. (plat_entry .eqs. "VMSVAX"))) then -
 | 
			
		||||
            truesum = truesum + 1
 | 
			
		||||
$!
 | 
			
		||||
$         if ((plat_entry .eqs. "!VMS") .or. -
 | 
			
		||||
            (arch_vax .and. (plat_entry .eqs. "!VMSVAX"))) then -
 | 
			
		||||
            falsesum = falsesum + 1
 | 
			
		||||
$!
 | 
			
		||||
$	  goto loop1
 | 
			
		||||
$       endif
 | 
			
		||||
$     endloop1:
 | 
			
		||||
 
 | 
			
		||||
@@ -8,31 +8,39 @@ $!
 | 
			
		||||
$!
 | 
			
		||||
$! Slightly modified by Richard Levitte <richard@levitte.org>
 | 
			
		||||
$!
 | 
			
		||||
$!
 | 
			
		||||
$! Always define OPENSSL.  Others are optional (non-null P1).
 | 
			
		||||
$!
 | 
			
		||||
$ OPENSSL  :== $SSLEXE:OPENSSL
 | 
			
		||||
$ VERIFY   :== $SSLEXE:OPENSSL VERIFY
 | 
			
		||||
$ ASN1PARSE:== $SSLEXE:OPENSSL ASN1PARS
 | 
			
		||||
$ REQ      :== $SSLEXE:OPENSSL REQ
 | 
			
		||||
$ DGST     :== $SSLEXE:OPENSSL DGST
 | 
			
		||||
$ DH       :== $SSLEXE:OPENSSL DH
 | 
			
		||||
$ ENC      :== $SSLEXE:OPENSSL ENC
 | 
			
		||||
$ GENDH    :== $SSLEXE:OPENSSL GENDH
 | 
			
		||||
$ ERRSTR   :== $SSLEXE:OPENSSL ERRSTR
 | 
			
		||||
$ CA       :== $SSLEXE:OPENSSL CA
 | 
			
		||||
$ CRL      :== $SSLEXE:OPENSSL CRL
 | 
			
		||||
$ RSA      :== $SSLEXE:OPENSSL RSA
 | 
			
		||||
$ DSA      :== $SSLEXE:OPENSSL DSA
 | 
			
		||||
$ DSAPARAM :== $SSLEXE:OPENSSL DSAPARAM
 | 
			
		||||
$ X509     :== $SSLEXE:OPENSSL X509
 | 
			
		||||
$ GENRSA   :== $SSLEXE:OPENSSL GENRSA
 | 
			
		||||
$ GENDSA   :== $SSLEXE:OPENSSL GENDSA
 | 
			
		||||
$ S_SERVER :== $SSLEXE:OPENSSL S_SERVER
 | 
			
		||||
$ S_CLIENT :== $SSLEXE:OPENSSL S_CLIENT
 | 
			
		||||
$ SPEED    :== $SSLEXE:OPENSSL SPEED
 | 
			
		||||
$ S_TIME   :== $SSLEXE:OPENSSL S_TIME
 | 
			
		||||
$ VERSION  :== $SSLEXE:OPENSSL VERSION
 | 
			
		||||
$ PKCS7    :== $SSLEXE:OPENSSL PKCS7
 | 
			
		||||
$ CRL2PKCS7:== $SSLEXE:OPENSSL CRL2P7
 | 
			
		||||
$ SESS_ID  :== $SSLEXE:OPENSSL SESS_ID
 | 
			
		||||
$ CIPHERS  :== $SSLEXE:OPENSSL CIPHERS
 | 
			
		||||
$ NSEQ     :== $SSLEXE:OPENSSL NSEQ
 | 
			
		||||
$ PKCS12   :== $SSLEXE:OPENSSL PKCS12
 | 
			
		||||
$
 | 
			
		||||
$ IF (P1 .NES. "")
 | 
			
		||||
$ THEN
 | 
			
		||||
$     VERIFY   :== $SSLEXE:OPENSSL VERIFY
 | 
			
		||||
$     ASN1PARSE:== $SSLEXE:OPENSSL ASN1PARS
 | 
			
		||||
$! REQ could conflict with REQUEST.
 | 
			
		||||
$     OREQ     :== $SSLEXE:OPENSSL REQ
 | 
			
		||||
$     DGST     :== $SSLEXE:OPENSSL DGST
 | 
			
		||||
$     DH       :== $SSLEXE:OPENSSL DH
 | 
			
		||||
$     ENC      :== $SSLEXE:OPENSSL ENC
 | 
			
		||||
$     GENDH    :== $SSLEXE:OPENSSL GENDH
 | 
			
		||||
$     ERRSTR   :== $SSLEXE:OPENSSL ERRSTR
 | 
			
		||||
$     CA       :== $SSLEXE:OPENSSL CA
 | 
			
		||||
$     CRL      :== $SSLEXE:OPENSSL CRL
 | 
			
		||||
$     RSA      :== $SSLEXE:OPENSSL RSA
 | 
			
		||||
$     DSA      :== $SSLEXE:OPENSSL DSA
 | 
			
		||||
$     DSAPARAM :== $SSLEXE:OPENSSL DSAPARAM
 | 
			
		||||
$     X509     :== $SSLEXE:OPENSSL X509
 | 
			
		||||
$     GENRSA   :== $SSLEXE:OPENSSL GENRSA
 | 
			
		||||
$     GENDSA   :== $SSLEXE:OPENSSL GENDSA
 | 
			
		||||
$     S_SERVER :== $SSLEXE:OPENSSL S_SERVER
 | 
			
		||||
$     S_CLIENT :== $SSLEXE:OPENSSL S_CLIENT
 | 
			
		||||
$     SPEED    :== $SSLEXE:OPENSSL SPEED
 | 
			
		||||
$     S_TIME   :== $SSLEXE:OPENSSL S_TIME
 | 
			
		||||
$     VERSION  :== $SSLEXE:OPENSSL VERSION
 | 
			
		||||
$     PKCS7    :== $SSLEXE:OPENSSL PKCS7
 | 
			
		||||
$     CRL2PKCS7:== $SSLEXE:OPENSSL CRL2P7
 | 
			
		||||
$     SESS_ID  :== $SSLEXE:OPENSSL SESS_ID
 | 
			
		||||
$     CIPHERS  :== $SSLEXE:OPENSSL CIPHERS
 | 
			
		||||
$     NSEQ     :== $SSLEXE:OPENSSL NSEQ
 | 
			
		||||
$     PKCS12   :== $SSLEXE:OPENSSL PKCS12
 | 
			
		||||
$ ENDIF
 | 
			
		||||
 
 | 
			
		||||
@@ -932,21 +932,20 @@ speed.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
 | 
			
		||||
speed.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
 | 
			
		||||
speed.o: ../include/openssl/err.h ../include/openssl/evp.h
 | 
			
		||||
speed.o: ../include/openssl/hmac.h ../include/openssl/idea.h
 | 
			
		||||
speed.o: ../include/openssl/lhash.h ../include/openssl/md2.h
 | 
			
		||||
speed.o: ../include/openssl/md4.h ../include/openssl/md5.h
 | 
			
		||||
speed.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
 | 
			
		||||
speed.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h
 | 
			
		||||
speed.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
 | 
			
		||||
speed.o: ../include/openssl/pkcs7.h ../include/openssl/rand.h
 | 
			
		||||
speed.o: ../include/openssl/rc2.h ../include/openssl/rc4.h
 | 
			
		||||
speed.o: ../include/openssl/ripemd.h ../include/openssl/rsa.h
 | 
			
		||||
speed.o: ../include/openssl/safestack.h ../include/openssl/seed.h
 | 
			
		||||
speed.o: ../include/openssl/sha.h ../include/openssl/stack.h
 | 
			
		||||
speed.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
 | 
			
		||||
speed.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h
 | 
			
		||||
speed.o: ../include/openssl/whrlpool.h ../include/openssl/x509.h
 | 
			
		||||
speed.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
 | 
			
		||||
speed.o: speed.c testdsa.h testrsa.h
 | 
			
		||||
speed.o: ../include/openssl/lhash.h ../include/openssl/md4.h
 | 
			
		||||
speed.o: ../include/openssl/md5.h ../include/openssl/obj_mac.h
 | 
			
		||||
speed.o: ../include/openssl/objects.h ../include/openssl/ocsp.h
 | 
			
		||||
speed.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 | 
			
		||||
speed.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
 | 
			
		||||
speed.o: ../include/openssl/rand.h ../include/openssl/rc2.h
 | 
			
		||||
speed.o: ../include/openssl/rc4.h ../include/openssl/ripemd.h
 | 
			
		||||
speed.o: ../include/openssl/rsa.h ../include/openssl/safestack.h
 | 
			
		||||
speed.o: ../include/openssl/seed.h ../include/openssl/sha.h
 | 
			
		||||
speed.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
 | 
			
		||||
speed.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
 | 
			
		||||
speed.o: ../include/openssl/ui_compat.h ../include/openssl/whrlpool.h
 | 
			
		||||
speed.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
 | 
			
		||||
speed.o: ../include/openssl/x509v3.h apps.h speed.c testdsa.h testrsa.h
 | 
			
		||||
spkac.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 | 
			
		||||
spkac.o: ../include/openssl/buffer.h ../include/openssl/conf.h
 | 
			
		||||
spkac.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
 | 
			
		||||
@@ -1005,17 +1004,16 @@ version.o: ../include/openssl/des_old.h ../include/openssl/e_os2.h
 | 
			
		||||
version.o: ../include/openssl/ec.h ../include/openssl/ecdh.h
 | 
			
		||||
version.o: ../include/openssl/ecdsa.h ../include/openssl/engine.h
 | 
			
		||||
version.o: ../include/openssl/evp.h ../include/openssl/idea.h
 | 
			
		||||
version.o: ../include/openssl/lhash.h ../include/openssl/md2.h
 | 
			
		||||
version.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h
 | 
			
		||||
version.o: ../include/openssl/ocsp.h ../include/openssl/opensslconf.h
 | 
			
		||||
version.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
 | 
			
		||||
version.o: ../include/openssl/pkcs7.h ../include/openssl/rc4.h
 | 
			
		||||
version.o: ../include/openssl/safestack.h ../include/openssl/sha.h
 | 
			
		||||
version.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
 | 
			
		||||
version.o: ../include/openssl/txt_db.h ../include/openssl/ui.h
 | 
			
		||||
version.o: ../include/openssl/ui_compat.h ../include/openssl/x509.h
 | 
			
		||||
version.o: ../include/openssl/x509_vfy.h ../include/openssl/x509v3.h apps.h
 | 
			
		||||
version.o: version.c
 | 
			
		||||
version.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h
 | 
			
		||||
version.o: ../include/openssl/objects.h ../include/openssl/ocsp.h
 | 
			
		||||
version.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
 | 
			
		||||
version.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h
 | 
			
		||||
version.o: ../include/openssl/rc4.h ../include/openssl/safestack.h
 | 
			
		||||
version.o: ../include/openssl/sha.h ../include/openssl/stack.h
 | 
			
		||||
version.o: ../include/openssl/symhacks.h ../include/openssl/txt_db.h
 | 
			
		||||
version.o: ../include/openssl/ui.h ../include/openssl/ui_compat.h
 | 
			
		||||
version.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h
 | 
			
		||||
version.o: ../include/openssl/x509v3.h apps.h version.c
 | 
			
		||||
x509.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h
 | 
			
		||||
x509.o: ../include/openssl/bn.h ../include/openssl/buffer.h
 | 
			
		||||
x509.o: ../include/openssl/conf.h ../include/openssl/crypto.h
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										47
									
								
								apps/apps.c
									
									
									
									
									
								
							
							
						
						
									
										47
									
								
								apps/apps.c
									
									
									
									
									
								
							@@ -109,14 +109,16 @@
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef _POSIX_C_SOURCE
 | 
			
		||||
#define _POSIX_C_SOURCE 2	/* On VMS, you need to define this to get
 | 
			
		||||
				   the declaration of fileno().  The value
 | 
			
		||||
				   2 is to make sure no function defined
 | 
			
		||||
				   in POSIX-2 is left undefined. */
 | 
			
		||||
#endif
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#ifndef OPENSSL_SYSNAME_WIN32
 | 
			
		||||
#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(NETWARE_CLIB)
 | 
			
		||||
#include <strings.h>
 | 
			
		||||
#endif
 | 
			
		||||
#include <sys/types.h>
 | 
			
		||||
@@ -259,13 +261,6 @@ int str2fmt(char *s)
 | 
			
		||||
		return(FORMAT_ASN1);
 | 
			
		||||
	else if ((*s == 'T') || (*s == 't'))
 | 
			
		||||
		return(FORMAT_TEXT);
 | 
			
		||||
	else if ((*s == 'P') || (*s == 'p'))
 | 
			
		||||
 		{
 | 
			
		||||
 		if (s[1] == 'V' || s[1] == 'v')
 | 
			
		||||
 			return FORMAT_PVK;
 | 
			
		||||
 		else
 | 
			
		||||
  			return(FORMAT_PEM);
 | 
			
		||||
 		}
 | 
			
		||||
  	else if ((*s == 'N') || (*s == 'n'))
 | 
			
		||||
  		return(FORMAT_NETSCAPE);
 | 
			
		||||
  	else if ((*s == 'S') || (*s == 's'))
 | 
			
		||||
@@ -278,6 +273,13 @@ int str2fmt(char *s)
 | 
			
		||||
		return(FORMAT_PKCS12);
 | 
			
		||||
	else if ((*s == 'E') || (*s == 'e'))
 | 
			
		||||
		return(FORMAT_ENGINE);
 | 
			
		||||
	else if ((*s == 'P') || (*s == 'p'))
 | 
			
		||||
 		{
 | 
			
		||||
 		if (s[1] == 'V' || s[1] == 'v')
 | 
			
		||||
 			return FORMAT_PVK;
 | 
			
		||||
 		else
 | 
			
		||||
  			return(FORMAT_PEM);
 | 
			
		||||
 		}
 | 
			
		||||
	else
 | 
			
		||||
		return(FORMAT_UNDEF);
 | 
			
		||||
	}
 | 
			
		||||
@@ -921,11 +923,13 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
 | 
			
		||||
				&pkey, NULL, NULL))
 | 
			
		||||
			goto end;
 | 
			
		||||
		}
 | 
			
		||||
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
 | 
			
		||||
	else if (format == FORMAT_MSBLOB)
 | 
			
		||||
		pkey = b2i_PrivateKey_bio(key);
 | 
			
		||||
	else if (format == FORMAT_PVK)
 | 
			
		||||
		pkey = b2i_PVK_bio(key, (pem_password_cb *)password_callback,
 | 
			
		||||
								&cb_data);
 | 
			
		||||
#endif
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(err,"bad input format specified for key file\n");
 | 
			
		||||
@@ -989,6 +993,7 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
 | 
			
		||||
		{
 | 
			
		||||
		pkey=d2i_PUBKEY_bio(key, NULL);
 | 
			
		||||
		}
 | 
			
		||||
#ifndef OPENSSL_NO_RSA
 | 
			
		||||
	else if (format == FORMAT_ASN1RSA)
 | 
			
		||||
		{
 | 
			
		||||
		RSA *rsa;
 | 
			
		||||
@@ -1018,7 +1023,7 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
 | 
			
		||||
		else
 | 
			
		||||
			pkey = NULL;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
	else if (format == FORMAT_PEM)
 | 
			
		||||
		{
 | 
			
		||||
		pkey=PEM_read_bio_PUBKEY(key,NULL,
 | 
			
		||||
@@ -1028,8 +1033,10 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
 | 
			
		||||
	else if (format == FORMAT_NETSCAPE || format == FORMAT_IISSGC)
 | 
			
		||||
		pkey = load_netscape_key(err, key, file, key_descrip, format);
 | 
			
		||||
#endif
 | 
			
		||||
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
 | 
			
		||||
	else if (format == FORMAT_MSBLOB)
 | 
			
		||||
		pkey = b2i_PublicKey_bio(key);
 | 
			
		||||
#endif
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(err,"bad input format specified for key file\n");
 | 
			
		||||
@@ -2185,7 +2192,7 @@ int args_verify(char ***pargs, int *pargc,
 | 
			
		||||
	ASN1_OBJECT *otmp = NULL;
 | 
			
		||||
	unsigned long flags = 0;
 | 
			
		||||
	int i;
 | 
			
		||||
	int purpose = 0;
 | 
			
		||||
	int purpose = 0, depth = -1;
 | 
			
		||||
	char **oldargs = *pargs;
 | 
			
		||||
	char *arg = **pargs, *argn = (*pargs)[1];
 | 
			
		||||
	if (!strcmp(arg, "-policy"))
 | 
			
		||||
@@ -2225,6 +2232,21 @@ int args_verify(char ***pargs, int *pargc,
 | 
			
		||||
			}
 | 
			
		||||
		(*pargs)++;
 | 
			
		||||
		}
 | 
			
		||||
	else if (strcmp(arg,"-verify_depth") == 0)
 | 
			
		||||
		{
 | 
			
		||||
		if (!argn)
 | 
			
		||||
			*badarg = 1;
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			depth = atoi(argn);
 | 
			
		||||
			if(depth < 0)
 | 
			
		||||
				{
 | 
			
		||||
				BIO_printf(err, "invalid depth\n");
 | 
			
		||||
				*badarg = 1;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		(*pargs)++;
 | 
			
		||||
		}
 | 
			
		||||
	else if (!strcmp(arg, "-ignore_critical"))
 | 
			
		||||
		flags |= X509_V_FLAG_IGNORE_CRITICAL;
 | 
			
		||||
	else if (!strcmp(arg, "-issuer_checks"))
 | 
			
		||||
@@ -2249,6 +2271,8 @@ int args_verify(char ***pargs, int *pargc,
 | 
			
		||||
		flags |= X509_V_FLAG_USE_DELTAS;
 | 
			
		||||
	else if (!strcmp(arg, "-policy_print"))
 | 
			
		||||
		flags |= X509_V_FLAG_NOTIFY_POLICY;
 | 
			
		||||
	else if (!strcmp(arg, "-check_ss_sig"))
 | 
			
		||||
		flags |= X509_V_FLAG_CHECK_SS_SIGNATURE;
 | 
			
		||||
	else
 | 
			
		||||
		return 0;
 | 
			
		||||
 | 
			
		||||
@@ -2274,6 +2298,9 @@ int args_verify(char ***pargs, int *pargc,
 | 
			
		||||
	if (purpose)
 | 
			
		||||
		X509_VERIFY_PARAM_set_purpose(*pm, purpose);
 | 
			
		||||
 | 
			
		||||
	if (depth >= 0)
 | 
			
		||||
		X509_VERIFY_PARAM_set_depth(*pm, depth);
 | 
			
		||||
 | 
			
		||||
	end:
 | 
			
		||||
 | 
			
		||||
	(*pargs)++;
 | 
			
		||||
 
 | 
			
		||||
@@ -704,7 +704,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
 | 
			
		||||
		if (secret_key && !secret_keyid)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err, "No sectre key id\n");
 | 
			
		||||
			BIO_printf(bio_err, "No secret key id\n");
 | 
			
		||||
			goto end;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										56
									
								
								apps/dgst.c
									
									
									
									
									
								
							
							
						
						
									
										56
									
								
								apps/dgst.c
									
									
									
									
									
								
							@@ -79,6 +79,26 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
 | 
			
		||||
	  const char *sig_name, const char *md_name,
 | 
			
		||||
	  const char *file,BIO *bmd);
 | 
			
		||||
 | 
			
		||||
static void list_md_fn(const EVP_MD *m,
 | 
			
		||||
			const char *from, const char *to, void *arg)
 | 
			
		||||
	{
 | 
			
		||||
	const char *mname;
 | 
			
		||||
	/* Skip aliases */
 | 
			
		||||
	if (!m)
 | 
			
		||||
		return;
 | 
			
		||||
	mname = OBJ_nid2ln(EVP_MD_type(m));
 | 
			
		||||
	/* Skip shortnames */
 | 
			
		||||
	if (strcmp(from, mname))
 | 
			
		||||
		return;
 | 
			
		||||
	/* Skip clones */
 | 
			
		||||
	if (EVP_MD_flags(m) & EVP_MD_FLAG_PKEY_DIGEST)
 | 
			
		||||
		return;
 | 
			
		||||
	if (strchr(mname, ' '))
 | 
			
		||||
		mname= EVP_MD_name(m);
 | 
			
		||||
	BIO_printf(arg, "-%-14s to use the %s message digest algorithm\n",
 | 
			
		||||
			mname, mname);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int MAIN(int, char **);
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char **argv)
 | 
			
		||||
@@ -249,43 +269,17 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		BIO_printf(bio_err,"-verify file    verify a signature using public key in file\n");
 | 
			
		||||
		BIO_printf(bio_err,"-prverify file  verify a signature using private key in file\n");
 | 
			
		||||
		BIO_printf(bio_err,"-keyform arg    key file format (PEM or ENGINE)\n");
 | 
			
		||||
		BIO_printf(bio_err,"-out filename   output to filename rather than stdout\n");
 | 
			
		||||
		BIO_printf(bio_err,"-signature file signature to verify\n");
 | 
			
		||||
		BIO_printf(bio_err,"-sigopt nm:v    signature parameter\n");
 | 
			
		||||
		BIO_printf(bio_err,"-hmac key       create hashed MAC with key\n");
 | 
			
		||||
		BIO_printf(bio_err,"-mac algorithm  create MAC (not neccessarily HMAC)\n"); 
 | 
			
		||||
		BIO_printf(bio_err,"-macopt nm:v    MAC algorithm parameters or key\n");
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
		BIO_printf(bio_err,"-engine e       use engine e, possibly a hardware device.\n");
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm (default)\n",
 | 
			
		||||
			LN_md5,LN_md5);
 | 
			
		||||
		BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
 | 
			
		||||
			LN_md4,LN_md4);
 | 
			
		||||
		BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
 | 
			
		||||
			LN_md2,LN_md2);
 | 
			
		||||
#ifndef OPENSSL_NO_SHA
 | 
			
		||||
		BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
 | 
			
		||||
			LN_sha1,LN_sha1);
 | 
			
		||||
#ifndef OPENSSL_NO_SHA256
 | 
			
		||||
		BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
 | 
			
		||||
			LN_sha224,LN_sha224);
 | 
			
		||||
		BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
 | 
			
		||||
			LN_sha256,LN_sha256);
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SHA512
 | 
			
		||||
		BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
 | 
			
		||||
			LN_sha384,LN_sha384);
 | 
			
		||||
		BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
 | 
			
		||||
			LN_sha512,LN_sha512);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
		BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
 | 
			
		||||
			LN_mdc2,LN_mdc2);
 | 
			
		||||
		BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
 | 
			
		||||
			LN_ripemd160,LN_ripemd160);
 | 
			
		||||
#ifndef OPENSSL_NO_WHIRLPOOL
 | 
			
		||||
		BIO_printf(bio_err,"-%-14s to use the %s message digest algorithm\n",
 | 
			
		||||
			SN_whirlpool,SN_whirlpool);
 | 
			
		||||
#endif
 | 
			
		||||
		EVP_MD_do_all_sorted(list_md_fn, bio_err);
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
@@ -600,7 +594,7 @@ int do_fp(BIO *out, unsigned char *buf, BIO *bp, int sep, int binout,
 | 
			
		||||
	else
 | 
			
		||||
		{
 | 
			
		||||
		len=BIO_gets(bp,(char *)buf,BUFSIZE);
 | 
			
		||||
		if (len <0) 
 | 
			
		||||
		if ((int)len <0)
 | 
			
		||||
			{
 | 
			
		||||
			ERR_print_errors(bio_err);
 | 
			
		||||
			return 1;
 | 
			
		||||
 
 | 
			
		||||
@@ -349,4 +349,10 @@ end:
 | 
			
		||||
	apps_shutdown();
 | 
			
		||||
	OPENSSL_EXIT(ret);
 | 
			
		||||
	}
 | 
			
		||||
#else /* !OPENSSL_NO_DH */
 | 
			
		||||
 | 
			
		||||
# if PEDANTIC
 | 
			
		||||
static void *dummy=&dummy;
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -554,4 +554,10 @@ static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
 | 
			
		||||
	return 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#else /* !OPENSSL_NO_DH */
 | 
			
		||||
 | 
			
		||||
# if PEDANTIC
 | 
			
		||||
static void *dummy=&dummy;
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -334,6 +334,7 @@ bad:
 | 
			
		||||
			i=PEM_write_bio_DSA_PUBKEY(out,dsa);
 | 
			
		||||
		else i=PEM_write_bio_DSAPrivateKey(out,dsa,enc,
 | 
			
		||||
							NULL,0,NULL, passout);
 | 
			
		||||
#ifndef OPENSSL_NO_RSA
 | 
			
		||||
	} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
 | 
			
		||||
		EVP_PKEY *pk;
 | 
			
		||||
		pk = EVP_PKEY_new();
 | 
			
		||||
@@ -345,6 +346,7 @@ bad:
 | 
			
		||||
		else
 | 
			
		||||
			i = i2b_PrivateKey_bio(out, pk);
 | 
			
		||||
		EVP_PKEY_free(pk);
 | 
			
		||||
#endif
 | 
			
		||||
	} else {
 | 
			
		||||
		BIO_printf(bio_err,"bad output format specified for outfile\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
@@ -365,4 +367,10 @@ end:
 | 
			
		||||
	apps_shutdown();
 | 
			
		||||
	OPENSSL_EXIT(ret);
 | 
			
		||||
	}
 | 
			
		||||
#else /* !OPENSSL_NO_DSA */
 | 
			
		||||
 | 
			
		||||
# if PEDANTIC
 | 
			
		||||
static void *dummy=&dummy;
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -475,4 +475,10 @@ static int MS_CALLBACK dsa_cb(int p, int n, BN_GENCB *cb)
 | 
			
		||||
#endif
 | 
			
		||||
	return 1;
 | 
			
		||||
	}
 | 
			
		||||
#else /* !OPENSSL_NO_DSA */
 | 
			
		||||
 | 
			
		||||
# if PEDANTIC
 | 
			
		||||
static void *dummy=&dummy;
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -400,4 +400,10 @@ end:
 | 
			
		||||
	apps_shutdown();
 | 
			
		||||
	OPENSSL_EXIT(ret);
 | 
			
		||||
}
 | 
			
		||||
#else /* !OPENSSL_NO_EC */
 | 
			
		||||
 | 
			
		||||
# if PEDANTIC
 | 
			
		||||
static void *dummy=&dummy;
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -725,4 +725,10 @@ static int ecparam_print_var(BIO *out, BIGNUM *in, const char *var,
 | 
			
		||||
	BIO_printf(out, "\n\t};\n\n");
 | 
			
		||||
	return 1;
 | 
			
		||||
	}
 | 
			
		||||
#else /* !OPENSSL_NO_EC */
 | 
			
		||||
 | 
			
		||||
# if PEDANTIC
 | 
			
		||||
static void *dummy=&dummy;
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -235,4 +235,10 @@ static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb)
 | 
			
		||||
#endif
 | 
			
		||||
	return 1;
 | 
			
		||||
	}
 | 
			
		||||
#else /* !OPENSSL_NO_DH */
 | 
			
		||||
 | 
			
		||||
# if PEDANTIC
 | 
			
		||||
static void *dummy=&dummy;
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -279,4 +279,10 @@ end:
 | 
			
		||||
	apps_shutdown();
 | 
			
		||||
	OPENSSL_EXIT(ret);
 | 
			
		||||
	}
 | 
			
		||||
#else /* !OPENSSL_NO_DSA */
 | 
			
		||||
 | 
			
		||||
# if PEDANTIC
 | 
			
		||||
static void *dummy=&dummy;
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -105,9 +105,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	char *inrand=NULL;
 | 
			
		||||
	BIO *out=NULL;
 | 
			
		||||
	BIGNUM *bn = BN_new();
 | 
			
		||||
	RSA *rsa = RSA_new();
 | 
			
		||||
	RSA *rsa = NULL;
 | 
			
		||||
 | 
			
		||||
	if(!bn || !rsa) goto err;
 | 
			
		||||
	if(!bn) goto err;
 | 
			
		||||
 | 
			
		||||
	apps_startup();
 | 
			
		||||
	BN_GENCB_set(&cb, genrsa_cb, bio_err);
 | 
			
		||||
@@ -266,6 +266,10 @@ bad:
 | 
			
		||||
	BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n",
 | 
			
		||||
		num);
 | 
			
		||||
 | 
			
		||||
	rsa = RSA_new();
 | 
			
		||||
	if (!rsa)
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	if(!BN_set_word(bn, f4) || !RSA_generate_key_ex(rsa, num, bn, &cb))
 | 
			
		||||
		goto err;
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
@@ -5,13 +5,23 @@ $! Time of creation: 22-MAY-1998 10:13
 | 
			
		||||
$!
 | 
			
		||||
$! P1	root of the directory tree
 | 
			
		||||
$!
 | 
			
		||||
$
 | 
			
		||||
$	IF P1 .EQS. ""
 | 
			
		||||
$	THEN
 | 
			
		||||
$	    WRITE SYS$OUTPUT "First argument missing."
 | 
			
		||||
$	    WRITE SYS$OUTPUT "Should be the directory where you want things installed."
 | 
			
		||||
$	    WRITE SYS$OUTPUT -
 | 
			
		||||
		  "Should be the directory where you want things installed."
 | 
			
		||||
$	    EXIT
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$
 | 
			
		||||
$	IF (F$GETSYI("CPU").LT.128)
 | 
			
		||||
$	THEN
 | 
			
		||||
$	    ARCH := VAX
 | 
			
		||||
$	ELSE
 | 
			
		||||
$	    ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
 | 
			
		||||
$	    IF (ARCH .EQS. "") THEN ARCH = "UNK"
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$
 | 
			
		||||
$	ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0"
 | 
			
		||||
$	ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY")
 | 
			
		||||
$	ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
 | 
			
		||||
@@ -19,23 +29,16 @@ $	ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
 | 
			
		||||
$	ROOT = ROOT_DEV + "[" + ROOT_DIR
 | 
			
		||||
$
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLVEXE WRK_SSLROOT:[VAX_EXE]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLAEXE WRK_SSLROOT:[ALPHA_EXE]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLLIB WRK_SSLROOT:[LIB]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLEXE WRK_SSLROOT:['ARCH'_EXE]
 | 
			
		||||
$
 | 
			
		||||
$	IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN -
 | 
			
		||||
	   CREATE/DIR/LOG WRK_SSLROOT:[000000]
 | 
			
		||||
$	IF F$PARSE("WRK_SSLVEXE:") .EQS. "" THEN -
 | 
			
		||||
	   CREATE/DIR/LOG WRK_SSLVEXE:
 | 
			
		||||
$	IF F$PARSE("WRK_SSLAEXE:") .EQS. "" THEN -
 | 
			
		||||
	   CREATE/DIR/LOG WRK_SSLAEXE:
 | 
			
		||||
$	IF F$PARSE("WRK_SSLLIB:") .EQS. "" THEN -
 | 
			
		||||
	   CREATE/DIR/LOG WRK_SSLLIB:
 | 
			
		||||
$	IF F$PARSE("WRK_SSLEXE:") .EQS. "" THEN -
 | 
			
		||||
	   CREATE/DIR/LOG WRK_SSLEXE:
 | 
			
		||||
$
 | 
			
		||||
$	EXE := openssl
 | 
			
		||||
$
 | 
			
		||||
$	VEXE_DIR := [-.VAX.EXE.APPS]
 | 
			
		||||
$	AEXE_DIR := [-.AXP.EXE.APPS]
 | 
			
		||||
$	EXE_DIR := [-.'ARCH'.EXE.APPS]
 | 
			
		||||
$
 | 
			
		||||
$	I = 0
 | 
			
		||||
$ LOOP_EXE: 
 | 
			
		||||
@@ -43,24 +46,17 @@ $	E = F$EDIT(F$ELEMENT(I, ",", EXE),"TRIM")
 | 
			
		||||
$	I = I + 1
 | 
			
		||||
$	IF E .EQS. "," THEN GOTO LOOP_EXE_END
 | 
			
		||||
$	SET NOON
 | 
			
		||||
$	IF F$SEARCH(VEXE_DIR+E+".EXE") .NES. ""
 | 
			
		||||
$	IF F$SEARCH(EXE_DIR+E+".EXE") .NES. ""
 | 
			
		||||
$	THEN
 | 
			
		||||
$	  COPY 'VEXE_DIR''E'.EXE WRK_SSLVEXE:'E'.EXE/log
 | 
			
		||||
$	  SET FILE/PROT=W:RE WRK_SSLVEXE:'E'.EXE
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$	IF F$SEARCH(AEXE_DIR+E+".EXE") .NES. ""
 | 
			
		||||
$	THEN
 | 
			
		||||
$	  COPY 'AEXE_DIR''E'.EXE WRK_SSLAEXE:'E'.EXE/log
 | 
			
		||||
$	  SET FILE/PROT=W:RE WRK_SSLAEXE:'E'.EXE
 | 
			
		||||
$	  COPY 'EXE_DIR''E'.EXE WRK_SSLEXE:'E'.EXE/log
 | 
			
		||||
$	  SET FILE/PROT=W:RE WRK_SSLEXE:'E'.EXE
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$	SET ON
 | 
			
		||||
$	GOTO LOOP_EXE
 | 
			
		||||
$ LOOP_EXE_END:
 | 
			
		||||
$
 | 
			
		||||
$	SET NOON
 | 
			
		||||
$	COPY CA.COM WRK_SSLAEXE:CA.COM/LOG
 | 
			
		||||
$	SET FILE/PROT=W:RE WRK_SSLAEXE:CA.COM
 | 
			
		||||
$	COPY CA.COM WRK_SSLVEXE:CA.COM/LOG
 | 
			
		||||
$	COPY CA.COM WRK_SSLEXE:CA.COM/LOG
 | 
			
		||||
$	SET FILE/PROT=W:RE WRK_SSLVEXE:CA.COM
 | 
			
		||||
$	COPY OPENSSL-VMS.CNF WRK_SSLROOT:[000000]OPENSSL.CNF/LOG
 | 
			
		||||
$	SET FILE/PROT=W:R WRK_SSLROOT:[000000]OPENSSL.CNF
 | 
			
		||||
 
 | 
			
		||||
@@ -10,7 +10,7 @@ $!
 | 
			
		||||
$!  This command files compiles and creates all the various different
 | 
			
		||||
$!  "application" programs for the different types of encryption for OpenSSL.
 | 
			
		||||
$!  The EXE's are placed in the directory [.xxx.EXE.APPS] where "xxx" denotes
 | 
			
		||||
$!  either AXP or VAX depending on your machine architecture.
 | 
			
		||||
$!  ALPHA, IA64 or VAX, depending on your machine architecture.
 | 
			
		||||
$!
 | 
			
		||||
$!  It was written so it would try to determine what "C" compiler to
 | 
			
		||||
$!  use or you can specify which "C" compiler to use.
 | 
			
		||||
@@ -46,20 +46,21 @@ $ TCPIP_LIB = ""
 | 
			
		||||
$!
 | 
			
		||||
$! Check What Architecture We Are Using.
 | 
			
		||||
$!
 | 
			
		||||
$ IF (F$GETSYI("CPU").GE.128)
 | 
			
		||||
$ IF (F$GETSYI("CPU").LT.128)
 | 
			
		||||
$ THEN
 | 
			
		||||
$!
 | 
			
		||||
$!  The Architecture Is AXP.
 | 
			
		||||
$!  The Architecture Is VAX.
 | 
			
		||||
$!
 | 
			
		||||
$   ARCH := AXP
 | 
			
		||||
$   ARCH := VAX
 | 
			
		||||
$!
 | 
			
		||||
$! Else...
 | 
			
		||||
$!
 | 
			
		||||
$ ELSE
 | 
			
		||||
$!
 | 
			
		||||
$!  The Architecture Is VAX.
 | 
			
		||||
$!  The Architecture Is Alpha, IA64 or whatever comes in the future.
 | 
			
		||||
$!
 | 
			
		||||
$   ARCH := VAX
 | 
			
		||||
$   ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
 | 
			
		||||
$   IF (ARCH .EQS. "") THEN ARCH = "UNK"
 | 
			
		||||
$!
 | 
			
		||||
$! End The Architecture Check.
 | 
			
		||||
$!
 | 
			
		||||
@@ -69,18 +70,6 @@ $! Define what programs should be compiled
 | 
			
		||||
$!
 | 
			
		||||
$ PROGRAMS := OPENSSL
 | 
			
		||||
$!
 | 
			
		||||
$! Check To Make Sure We Have Valid Command Line Parameters.
 | 
			
		||||
$!
 | 
			
		||||
$ GOSUB CHECK_OPTIONS
 | 
			
		||||
$!
 | 
			
		||||
$! Initialise logical names and such
 | 
			
		||||
$!
 | 
			
		||||
$ GOSUB INITIALISE
 | 
			
		||||
$!
 | 
			
		||||
$! Tell The User What Kind of Machine We Run On.
 | 
			
		||||
$!
 | 
			
		||||
$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
 | 
			
		||||
$!
 | 
			
		||||
$! Define The CRYPTO Library.
 | 
			
		||||
$!
 | 
			
		||||
$ CRYPTO_LIB := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]LIBCRYPTO.OLB
 | 
			
		||||
@@ -93,6 +82,22 @@ $! Define The OBJ Directory.
 | 
			
		||||
$!
 | 
			
		||||
$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.APPS]
 | 
			
		||||
$!
 | 
			
		||||
$! Define The EXE Directory.
 | 
			
		||||
$!
 | 
			
		||||
$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.APPS]
 | 
			
		||||
$!
 | 
			
		||||
$! Check To Make Sure We Have Valid Command Line Parameters.
 | 
			
		||||
$!
 | 
			
		||||
$ GOSUB CHECK_OPTIONS
 | 
			
		||||
$!
 | 
			
		||||
$! Initialise logical names and such
 | 
			
		||||
$!
 | 
			
		||||
$ GOSUB INITIALISE
 | 
			
		||||
$!
 | 
			
		||||
$! Tell The User What Kind of Machine We Run On.
 | 
			
		||||
$!
 | 
			
		||||
$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
 | 
			
		||||
$!
 | 
			
		||||
$! Check To See If The OBJ Directory Exists.
 | 
			
		||||
$!
 | 
			
		||||
$ IF (F$PARSE(OBJ_DIR).EQS."")
 | 
			
		||||
@@ -106,10 +111,6 @@ $! End The OBJ Directory Check.
 | 
			
		||||
$!
 | 
			
		||||
$ ENDIF
 | 
			
		||||
$!
 | 
			
		||||
$! Define The EXE Directory.
 | 
			
		||||
$!
 | 
			
		||||
$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.APPS]
 | 
			
		||||
$!
 | 
			
		||||
$! Check To See If The EXE Directory Exists.
 | 
			
		||||
$!
 | 
			
		||||
$ IF (F$PARSE(EXE_DIR).EQS."")
 | 
			
		||||
@@ -132,6 +133,9 @@ $!
 | 
			
		||||
$ GOSUB CHECK_OPT_FILE
 | 
			
		||||
$!
 | 
			
		||||
$! Define The Application Files.
 | 
			
		||||
$! NOTE: Some might think this list ugly.  However, it's made this way to
 | 
			
		||||
$! reflect the E_OBJ variable in Makefile as closely as possible, thereby
 | 
			
		||||
$! making it fairly easy to verify that the lists are the same.
 | 
			
		||||
$!
 | 
			
		||||
$ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+-
 | 
			
		||||
	     	"CA,PKCS7,CRL2P7,CRL,"+-
 | 
			
		||||
@@ -420,19 +424,19 @@ $!    Else...
 | 
			
		||||
$!
 | 
			
		||||
$     ELSE
 | 
			
		||||
$!
 | 
			
		||||
$!      Create The AXP Linker Option File.
 | 
			
		||||
$!      Create The non-VAX Linker Option File.
 | 
			
		||||
$!
 | 
			
		||||
$       CREATE 'OPT_FILE'
 | 
			
		||||
$DECK
 | 
			
		||||
!
 | 
			
		||||
! Default System Options File For AXP To Link Agianst 
 | 
			
		||||
! Default System Options File For non-VAX To Link Agianst 
 | 
			
		||||
! The Sharable C Runtime Library.
 | 
			
		||||
!
 | 
			
		||||
SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
 | 
			
		||||
SYS$SHARE:CMA$OPEN_RTL/SHARE
 | 
			
		||||
$EOD
 | 
			
		||||
$!
 | 
			
		||||
$!    End The VAX/AXP DEC C Option File Check.
 | 
			
		||||
$!    End The DEC C Option File Check.
 | 
			
		||||
$!
 | 
			
		||||
$     ENDIF
 | 
			
		||||
$!
 | 
			
		||||
@@ -581,7 +585,7 @@ $   ELSE
 | 
			
		||||
$!
 | 
			
		||||
$!  Check To See If We Have VAXC Or DECC.
 | 
			
		||||
$!
 | 
			
		||||
$     IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
 | 
			
		||||
$     IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
 | 
			
		||||
$     THEN 
 | 
			
		||||
$!
 | 
			
		||||
$!      Looks Like DECC, Set To Use DECC.
 | 
			
		||||
@@ -691,7 +695,7 @@ $     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
$!
 | 
			
		||||
$     OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
 | 
			
		||||
$     OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT"
 | 
			
		||||
$!
 | 
			
		||||
$!  End DECC Check.
 | 
			
		||||
$!
 | 
			
		||||
@@ -712,9 +716,9 @@ $!
 | 
			
		||||
$!    Compile Using VAXC.
 | 
			
		||||
$!
 | 
			
		||||
$     CC = "CC"
 | 
			
		||||
$     IF ARCH.EQS."AXP"
 | 
			
		||||
$     IF ARCH.NES."VAX"
 | 
			
		||||
$     THEN
 | 
			
		||||
$	WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
 | 
			
		||||
$	WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
 | 
			
		||||
$	EXIT
 | 
			
		||||
$     ENDIF
 | 
			
		||||
$     IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
 | 
			
		||||
@@ -728,7 +732,7 @@ $     DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
$!
 | 
			
		||||
$     OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
 | 
			
		||||
$     OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT"
 | 
			
		||||
$!
 | 
			
		||||
$!  End VAXC Check
 | 
			
		||||
$!
 | 
			
		||||
@@ -755,7 +759,7 @@ $     CC = GCC+"/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
$!
 | 
			
		||||
$     OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
 | 
			
		||||
$     OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT"
 | 
			
		||||
$!
 | 
			
		||||
$!  End The GNU C Check.
 | 
			
		||||
$!
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,8 @@
 | 
			
		||||
				   on OpenVMS */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#define USE_SOCKETS
 | 
			
		||||
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <stdlib.h>
 | 
			
		||||
#include <string.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -231,7 +231,7 @@ keyUsage = nonRepudiation, digitalSignature, keyEncipherment
 | 
			
		||||
 | 
			
		||||
subjectKeyIdentifier=hash
 | 
			
		||||
 | 
			
		||||
authorityKeyIdentifier=keyid:always,issuer:always
 | 
			
		||||
authorityKeyIdentifier=keyid:always,issuer
 | 
			
		||||
 | 
			
		||||
# This is what PKIX recommends but some broken software chokes on critical
 | 
			
		||||
# extensions.
 | 
			
		||||
@@ -264,7 +264,7 @@ basicConstraints = CA:true
 | 
			
		||||
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
 | 
			
		||||
 | 
			
		||||
# issuerAltName=issuer:copy
 | 
			
		||||
authorityKeyIdentifier=keyid:always,issuer:always
 | 
			
		||||
authorityKeyIdentifier=keyid:always
 | 
			
		||||
 | 
			
		||||
[ proxy_cert_ext ]
 | 
			
		||||
# These extensions should be added when creating a proxy certificate
 | 
			
		||||
@@ -297,7 +297,7 @@ nsComment			= "OpenSSL Generated Certificate"
 | 
			
		||||
 | 
			
		||||
# PKIX recommendations harmless if included in all certificates.
 | 
			
		||||
subjectKeyIdentifier=hash
 | 
			
		||||
authorityKeyIdentifier=keyid,issuer:always
 | 
			
		||||
authorityKeyIdentifier=keyid,issuer
 | 
			
		||||
 | 
			
		||||
# This stuff is for subjectAltName and issuerAltname.
 | 
			
		||||
# Import the email address.
 | 
			
		||||
 
 | 
			
		||||
@@ -231,7 +231,7 @@ keyUsage = nonRepudiation, digitalSignature, keyEncipherment
 | 
			
		||||
 | 
			
		||||
subjectKeyIdentifier=hash
 | 
			
		||||
 | 
			
		||||
authorityKeyIdentifier=keyid:always,issuer:always
 | 
			
		||||
authorityKeyIdentifier=keyid:always,issuer
 | 
			
		||||
 | 
			
		||||
# This is what PKIX recommends but some broken software chokes on critical
 | 
			
		||||
# extensions.
 | 
			
		||||
@@ -264,7 +264,7 @@ basicConstraints = CA:true
 | 
			
		||||
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.
 | 
			
		||||
 | 
			
		||||
# issuerAltName=issuer:copy
 | 
			
		||||
authorityKeyIdentifier=keyid:always,issuer:always
 | 
			
		||||
authorityKeyIdentifier=keyid:always
 | 
			
		||||
 | 
			
		||||
[ proxy_cert_ext ]
 | 
			
		||||
# These extensions should be added when creating a proxy certificate
 | 
			
		||||
@@ -297,7 +297,7 @@ nsComment			= "OpenSSL Generated Certificate"
 | 
			
		||||
 | 
			
		||||
# PKIX recommendations harmless if included in all certificates.
 | 
			
		||||
subjectKeyIdentifier=hash
 | 
			
		||||
authorityKeyIdentifier=keyid,issuer:always
 | 
			
		||||
authorityKeyIdentifier=keyid,issuer
 | 
			
		||||
 | 
			
		||||
# This stuff is for subjectAltName and issuerAltname.
 | 
			
		||||
# Import the email address.
 | 
			
		||||
 
 | 
			
		||||
@@ -923,7 +923,7 @@ int print_attribs (BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst,const char *name)
 | 
			
		||||
			av = sk_ASN1_TYPE_value(attr->value.set, 0);
 | 
			
		||||
			switch(av->type) {
 | 
			
		||||
				case V_ASN1_BMPSTRING:
 | 
			
		||||
        			value = uni2asc(av->value.bmpstring->data,
 | 
			
		||||
        			value = OPENSSL_uni2asc(av->value.bmpstring->data,
 | 
			
		||||
                                	       av->value.bmpstring->length);
 | 
			
		||||
				BIO_printf(out, "%s\n", value);
 | 
			
		||||
				OPENSSL_free(value);
 | 
			
		||||
 
 | 
			
		||||
@@ -179,7 +179,7 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	pkey = PEM_read_bio_Parameters(in, NULL);
 | 
			
		||||
	if (!pkey)
 | 
			
		||||
		{
 | 
			
		||||
		BIO_printf(bio_err, "Error reading paramters\n");
 | 
			
		||||
		BIO_printf(bio_err, "Error reading parameters\n");
 | 
			
		||||
		ERR_print_errors(bio_err);
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -390,7 +390,7 @@ static void usage()
 | 
			
		||||
	BIO_printf(bio_err, "Usage: pkeyutl [options]\n");
 | 
			
		||||
	BIO_printf(bio_err, "-in file        input file\n");
 | 
			
		||||
	BIO_printf(bio_err, "-out file       output file\n");
 | 
			
		||||
	BIO_printf(bio_err, "-signature file signature file (verify operation only)\n");
 | 
			
		||||
	BIO_printf(bio_err, "-sigfile file signature file (verify operation only)\n");
 | 
			
		||||
	BIO_printf(bio_err, "-inkey file     input key\n");
 | 
			
		||||
	BIO_printf(bio_err, "-keyform arg    private key format - default PEM\n");
 | 
			
		||||
	BIO_printf(bio_err, "-pubin          input is a public key\n");
 | 
			
		||||
 
 | 
			
		||||
@@ -142,7 +142,9 @@ FUNCTION functions[] = {
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	{FUNC_TYPE_GENERAL,"engine",engine_main},
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_OCSP
 | 
			
		||||
	{FUNC_TYPE_GENERAL,"ocsp",ocsp_main},
 | 
			
		||||
#endif
 | 
			
		||||
	{FUNC_TYPE_GENERAL,"prime",prime_main},
 | 
			
		||||
	{FUNC_TYPE_GENERAL,"ts",ts_main},
 | 
			
		||||
#ifndef OPENSSL_NO_MD2
 | 
			
		||||
 
 | 
			
		||||
@@ -22,6 +22,7 @@ typedef struct {
 | 
			
		||||
	const char *name;
 | 
			
		||||
	int (*func)(int argc,char *argv[]);
 | 
			
		||||
	} FUNCTION;
 | 
			
		||||
DECLARE_LHASH_OF(FUNCTION);
 | 
			
		||||
 | 
			
		||||
FUNCTION functions[] = {
 | 
			
		||||
EOF
 | 
			
		||||
@@ -48,6 +49,8 @@ foreach (@ARGV)
 | 
			
		||||
		{ print "#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_SHA1)\n${str}#endif\n"; }
 | 
			
		||||
	elsif ( ($_ =~ /^cms$/))
 | 
			
		||||
		{ print "#ifndef OPENSSL_NO_CMS\n${str}#endif\n"; }
 | 
			
		||||
	elsif ( ($_ =~ /^ocsp$/))
 | 
			
		||||
		{ print "#ifndef OPENSSL_NO_OCSP\n${str}#endif\n"; }
 | 
			
		||||
	else
 | 
			
		||||
		{ print $str; }
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										13
									
								
								apps/req.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								apps/req.c
									
									
									
									
									
								
							@@ -365,11 +365,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			serial = s2i_ASN1_INTEGER(NULL, *(++argv));
 | 
			
		||||
			if (!serial) goto bad;
 | 
			
		||||
			}
 | 
			
		||||
		else if ((md_alg=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
 | 
			
		||||
			{
 | 
			
		||||
			/* ok */
 | 
			
		||||
			digest=md_alg;
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-extensions") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
@@ -380,6 +375,11 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			req_exts = *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if ((md_alg=EVP_get_digestbyname(&((*argv)[1]))) != NULL)
 | 
			
		||||
			{
 | 
			
		||||
			/* ok */
 | 
			
		||||
			digest=md_alg;
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(bio_err,"unknown option %s\n",*argv);
 | 
			
		||||
@@ -1715,7 +1715,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
 | 
			
		||||
		ERR_print_errors(err);
 | 
			
		||||
		return NULL;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_RSA
 | 
			
		||||
	if ((*pkey_type == EVP_PKEY_RSA) && (keylen != -1))
 | 
			
		||||
		{
 | 
			
		||||
		if (EVP_PKEY_CTX_set_rsa_keygen_bits(gctx, keylen) <= 0)
 | 
			
		||||
@@ -1726,6 +1726,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(BIO *err, const char *gstr, int *pkey_type,
 | 
			
		||||
			return NULL;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	return gctx;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -409,6 +409,7 @@ bad:
 | 
			
		||||
			}
 | 
			
		||||
		else i=PEM_write_bio_RSAPrivateKey(out,rsa,
 | 
			
		||||
						enc,NULL,0,NULL,passout);
 | 
			
		||||
#ifndef OPENSSL_NO_DSA
 | 
			
		||||
	} else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) {
 | 
			
		||||
		EVP_PKEY *pk;
 | 
			
		||||
		pk = EVP_PKEY_new();
 | 
			
		||||
@@ -420,6 +421,7 @@ bad:
 | 
			
		||||
		else
 | 
			
		||||
			i = i2b_PrivateKey_bio(out, pk);
 | 
			
		||||
		EVP_PKEY_free(pk);
 | 
			
		||||
#endif
 | 
			
		||||
	} else	{
 | 
			
		||||
		BIO_printf(bio_err,"bad output format specified for outfile\n");
 | 
			
		||||
		goto end;
 | 
			
		||||
 
 | 
			
		||||
@@ -342,4 +342,10 @@ static void usage()
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#else /* !OPENSSL_NO_RSA */
 | 
			
		||||
 | 
			
		||||
# if PEDANTIC
 | 
			
		||||
static void *dummy=&dummy;
 | 
			
		||||
# endif
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -320,7 +320,7 @@ static void sc_usage(void)
 | 
			
		||||
	BIO_printf(bio_err," -ssl3         - just use SSLv3\n");
 | 
			
		||||
	BIO_printf(bio_err," -tls1         - just use TLSv1\n");
 | 
			
		||||
	BIO_printf(bio_err," -dtls1        - just use DTLSv1\n");    
 | 
			
		||||
	BIO_printf(bio_err," -mtu          - set the MTU\n");
 | 
			
		||||
	BIO_printf(bio_err," -mtu          - set the link layer MTU\n");
 | 
			
		||||
	BIO_printf(bio_err," -no_tls1/-no_ssl3/-no_ssl2 - turn off that protocol\n");
 | 
			
		||||
	BIO_printf(bio_err," -bugs         - Switch on all SSL implementation bug workarounds\n");
 | 
			
		||||
	BIO_printf(bio_err," -serverpref   - Use server's cipher preferences (only SSLv2)\n");
 | 
			
		||||
@@ -383,7 +383,6 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	{
 | 
			
		||||
	int off=0;
 | 
			
		||||
	SSL *con=NULL;
 | 
			
		||||
	X509_STORE *store = NULL;
 | 
			
		||||
	int s,k,width,state=0;
 | 
			
		||||
	char *cbuf=NULL,*sbuf=NULL,*mbuf=NULL;
 | 
			
		||||
	int cbuf_len,cbuf_off;
 | 
			
		||||
@@ -404,7 +403,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
	SSL_CTX *ctx=NULL;
 | 
			
		||||
	int ret=1,in_init=1,i,nbio_test=0;
 | 
			
		||||
	int starttls_proto = PROTO_OFF;
 | 
			
		||||
	int prexit = 0, vflags = 0;
 | 
			
		||||
	int prexit = 0;
 | 
			
		||||
	X509_VERIFY_PARAM *vpm = NULL;
 | 
			
		||||
	int badarg = 0;
 | 
			
		||||
	const SSL_METHOD *meth=NULL;
 | 
			
		||||
	int socket_type=SOCK_STREAM;
 | 
			
		||||
	BIO *sbio;
 | 
			
		||||
@@ -521,10 +522,12 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			cert_format = str2fmt(*(++argv));
 | 
			
		||||
			}
 | 
			
		||||
		else if	(strcmp(*argv,"-crl_check") == 0)
 | 
			
		||||
			vflags |= X509_V_FLAG_CRL_CHECK;
 | 
			
		||||
		else if	(strcmp(*argv,"-crl_check_all") == 0)
 | 
			
		||||
			vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
 | 
			
		||||
		else if (args_verify(&argv, &argc, &badarg, bio_err, &vpm))
 | 
			
		||||
			{
 | 
			
		||||
			if (badarg)
 | 
			
		||||
				goto bad;
 | 
			
		||||
			continue;
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-verify_return_error") == 0)
 | 
			
		||||
			verify_return_error = 1;
 | 
			
		||||
		else if	(strcmp(*argv,"-prexit") == 0)
 | 
			
		||||
@@ -831,6 +834,9 @@ bad:
 | 
			
		||||
		goto end;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (vpm)
 | 
			
		||||
		SSL_CTX_set1_param(ctx, vpm);
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
	if (ssl_client_engine)
 | 
			
		||||
		{
 | 
			
		||||
@@ -890,8 +896,6 @@ bad:
 | 
			
		||||
		/* goto end; */
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	store = SSL_CTX_get_cert_store(ctx);
 | 
			
		||||
	X509_STORE_set_flags(store, vflags);
 | 
			
		||||
#ifndef OPENSSL_NO_TLSEXT
 | 
			
		||||
	if (servername != NULL)
 | 
			
		||||
		{
 | 
			
		||||
@@ -999,10 +1003,10 @@ re_start:
 | 
			
		||||
			BIO_ctrl(sbio, BIO_CTRL_DGRAM_SET_SEND_TIMEOUT, 0, &timeout);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (socket_mtu > 0)
 | 
			
		||||
		if (socket_mtu > 28)
 | 
			
		||||
			{
 | 
			
		||||
			SSL_set_options(con, SSL_OP_NO_QUERY_MTU);
 | 
			
		||||
			SSL_set_mtu(con, socket_mtu);
 | 
			
		||||
			SSL_set_mtu(con, socket_mtu - 28);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			/* want to do MTU discovery */
 | 
			
		||||
 
 | 
			
		||||
@@ -298,7 +298,9 @@ static const char *session_id_prefix=NULL;
 | 
			
		||||
 | 
			
		||||
static int enable_timeouts = 0;
 | 
			
		||||
static long socket_mtu;
 | 
			
		||||
#ifndef OPENSSL_NO_DTLS1
 | 
			
		||||
static int cert_chain = 0;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_PSK
 | 
			
		||||
static char *psk_identity="Client_identity";
 | 
			
		||||
@@ -459,7 +461,7 @@ static void sv_usage(void)
 | 
			
		||||
	BIO_printf(bio_err," -tls1         - Just talk TLSv1\n");
 | 
			
		||||
	BIO_printf(bio_err," -dtls1        - Just talk DTLSv1\n");
 | 
			
		||||
	BIO_printf(bio_err," -timeout      - Enable timeouts\n");
 | 
			
		||||
	BIO_printf(bio_err," -mtu          - Set MTU\n");
 | 
			
		||||
	BIO_printf(bio_err," -mtu          - Set link layer MTU\n");
 | 
			
		||||
	BIO_printf(bio_err," -chain        - Read a certificate chain\n");
 | 
			
		||||
	BIO_printf(bio_err," -no_ssl2      - Just disable SSLv2\n");
 | 
			
		||||
	BIO_printf(bio_err," -no_ssl3      - Just disable SSLv3\n");
 | 
			
		||||
@@ -671,7 +673,7 @@ static int MS_CALLBACK ssl_servername_cb(SSL *s, int *ad, void *arg)
 | 
			
		||||
			return p->extension_error;
 | 
			
		||||
		if (ctx2)
 | 
			
		||||
			{
 | 
			
		||||
			BIO_printf(p->biodebug,"Swiching server context.\n");
 | 
			
		||||
			BIO_printf(p->biodebug,"Switching server context.\n");
 | 
			
		||||
			SSL_set_SSL_CTX(s,ctx2);
 | 
			
		||||
			}     
 | 
			
		||||
		}
 | 
			
		||||
@@ -833,8 +835,8 @@ static char *jpake_secret = NULL;
 | 
			
		||||
 | 
			
		||||
int MAIN(int argc, char *argv[])
 | 
			
		||||
	{
 | 
			
		||||
	X509_STORE *store = NULL;
 | 
			
		||||
	int vflags = 0;
 | 
			
		||||
	X509_VERIFY_PARAM *vpm = NULL;
 | 
			
		||||
	int badarg = 0;
 | 
			
		||||
	short port=PORT;
 | 
			
		||||
	char *CApath=NULL,*CAfile=NULL;
 | 
			
		||||
	unsigned char *context = NULL;
 | 
			
		||||
@@ -999,13 +1001,11 @@ int MAIN(int argc, char *argv[])
 | 
			
		||||
			if (--argc < 1) goto bad;
 | 
			
		||||
			CApath= *(++argv);
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-crl_check") == 0)
 | 
			
		||||
		else if (args_verify(&argv, &argc, &badarg, bio_err, &vpm))
 | 
			
		||||
			{
 | 
			
		||||
			vflags |= X509_V_FLAG_CRL_CHECK;
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-crl_check_all") == 0)
 | 
			
		||||
			{
 | 
			
		||||
			vflags |= X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL;
 | 
			
		||||
			if (badarg)
 | 
			
		||||
				goto bad;
 | 
			
		||||
			continue;
 | 
			
		||||
			}
 | 
			
		||||
		else if (strcmp(*argv,"-verify_return_error") == 0)
 | 
			
		||||
			verify_return_error = 1;
 | 
			
		||||
@@ -1410,8 +1410,8 @@ bad:
 | 
			
		||||
		ERR_print_errors(bio_err);
 | 
			
		||||
		/* goto end; */
 | 
			
		||||
		}
 | 
			
		||||
	store = SSL_CTX_get_cert_store(ctx);
 | 
			
		||||
	X509_STORE_set_flags(store, vflags);
 | 
			
		||||
	if (vpm)
 | 
			
		||||
		SSL_CTX_set1_param(ctx, vpm);
 | 
			
		||||
 | 
			
		||||
#ifndef OPENSSL_NO_TLSEXT
 | 
			
		||||
	if (s_cert2)
 | 
			
		||||
@@ -1462,8 +1462,8 @@ bad:
 | 
			
		||||
			{
 | 
			
		||||
			ERR_print_errors(bio_err);
 | 
			
		||||
			}
 | 
			
		||||
		store = SSL_CTX_get_cert_store(ctx2);
 | 
			
		||||
		X509_STORE_set_flags(store, vflags);
 | 
			
		||||
		if (vpm)
 | 
			
		||||
			SSL_CTX_set1_param(ctx2, vpm);
 | 
			
		||||
		}
 | 
			
		||||
#endif 
 | 
			
		||||
 | 
			
		||||
@@ -1823,10 +1823,10 @@ static int sv_body(char *hostname, int s, unsigned char *context)
 | 
			
		||||
			BIO_ctrl(sbio, BIO_CTRL_DGRAM_SET_SEND_TIMEOUT, 0, &timeout);
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (socket_mtu > 0)
 | 
			
		||||
		if (socket_mtu > 28)
 | 
			
		||||
			{
 | 
			
		||||
			SSL_set_options(con, SSL_OP_NO_QUERY_MTU);
 | 
			
		||||
			SSL_set_mtu(con, socket_mtu);
 | 
			
		||||
			SSL_set_mtu(con, socket_mtu - 28);
 | 
			
		||||
			}
 | 
			
		||||
		else
 | 
			
		||||
			/* want to do MTU discovery */
 | 
			
		||||
 
 | 
			
		||||
@@ -1129,6 +1129,14 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
			rsa_doit[i]=1;
 | 
			
		||||
		for (i=0; i<DSA_NUM; i++)
 | 
			
		||||
			dsa_doit[i]=1;
 | 
			
		||||
#ifndef OPENSSL_NO_ECDSA
 | 
			
		||||
		for (i=0; i<EC_NUM; i++)
 | 
			
		||||
			ecdsa_doit[i]=1;
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_ECDH
 | 
			
		||||
		for (i=0; i<EC_NUM; i++)
 | 
			
		||||
			ecdh_doit[i]=1;
 | 
			
		||||
#endif
 | 
			
		||||
		}
 | 
			
		||||
	for (i=0; i<ALGOR_NUM; i++)
 | 
			
		||||
		if (doit[i]) pr_header++;
 | 
			
		||||
 
 | 
			
		||||
@@ -165,6 +165,9 @@ int MAIN(int argc, char **argv)
 | 
			
		||||
		BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (!load_config(bio_err, NULL))
 | 
			
		||||
		goto cleanup;
 | 
			
		||||
 | 
			
		||||
	for (argc--, argv++; argc > 0; argc--, argv++)
 | 
			
		||||
		{
 | 
			
		||||
		if (strcmp(*argv, "-config") == 0)
 | 
			
		||||
 
 | 
			
		||||
@@ -626,7 +626,7 @@ bad:
 | 
			
		||||
		if (!X509_set_subject_name(x,req->req_info->subject)) goto end;
 | 
			
		||||
 | 
			
		||||
		X509_gmtime_adj(X509_get_notBefore(x),0);
 | 
			
		||||
	        X509_gmtime_adj(X509_get_notAfter(x),(long)60*60*24*days);
 | 
			
		||||
	        X509_time_adj_ex(X509_get_notAfter(x),days, 0, NULL);
 | 
			
		||||
 | 
			
		||||
		pkey = X509_REQ_get_pubkey(req);
 | 
			
		||||
		X509_set_pubkey(x,pkey);
 | 
			
		||||
@@ -1130,6 +1130,7 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
 | 
			
		||||
	/* NOTE: this certificate can/should be self signed, unless it was
 | 
			
		||||
	 * a certificate request in which case it is not. */
 | 
			
		||||
	X509_STORE_CTX_set_cert(&xsc,x);
 | 
			
		||||
	X509_STORE_CTX_set_flags(&xsc, X509_V_FLAG_CHECK_SS_SIGNATURE);
 | 
			
		||||
	if (!reqfile && X509_verify_cert(&xsc) <= 0)
 | 
			
		||||
		goto end;
 | 
			
		||||
 | 
			
		||||
@@ -1146,7 +1147,7 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
 | 
			
		||||
		goto end;
 | 
			
		||||
 | 
			
		||||
	/* hardwired expired */
 | 
			
		||||
	if (X509_gmtime_adj(X509_get_notAfter(x),(long)60*60*24*days) == NULL)
 | 
			
		||||
	if (X509_time_adj_ex(X509_get_notAfter(x),days, 0, NULL) == NULL)
 | 
			
		||||
		goto end;
 | 
			
		||||
 | 
			
		||||
	if (clrext)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								config
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								config
									
									
									
									
									
								
							@@ -496,6 +496,12 @@ echo Operating system: $GUESSOS
 | 
			
		||||
# script above so we end up with values in vars but that would take
 | 
			
		||||
# more time that I want to waste at the moment
 | 
			
		||||
case "$GUESSOS" in
 | 
			
		||||
  uClinux*64*)
 | 
			
		||||
    OUT=uClinux-dist64
 | 
			
		||||
	;;
 | 
			
		||||
  uClinux*)
 | 
			
		||||
    OUT=uClinux-dist
 | 
			
		||||
	;;
 | 
			
		||||
  mips2-sgi-irix)
 | 
			
		||||
	CPU=`(hinv -t cpu) 2>/dev/null | head -1 | sed 's/^CPU:[^R]*R\([0-9]*\).*/\1/'`
 | 
			
		||||
	CPU=${CPU:-0}
 | 
			
		||||
@@ -798,6 +804,8 @@ case "$GUESSOS" in
 | 
			
		||||
  j90-cray-unicos) OUT="cray-j90" ;;
 | 
			
		||||
  nsr-tandem-nsk) OUT="tandem-c89" ;;
 | 
			
		||||
  beos-*) OUT="$GUESSOS" ;;
 | 
			
		||||
  x86pc-*-qnx6) OUT="QNX6-i386" ;;
 | 
			
		||||
  *-*-qnx6) OUT="QNX6" ;;
 | 
			
		||||
  *) OUT=`echo $GUESSOS | awk -F- '{print $3}'`;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -5,9 +5,9 @@
 | 
			
		||||
DIR=		crypto
 | 
			
		||||
TOP=		..
 | 
			
		||||
CC=		cc
 | 
			
		||||
INCLUDE=	-I. -I$(TOP) -I../include
 | 
			
		||||
INCLUDE=	-I. -I$(TOP) -I../include $(ZLIB_INCLUDE)
 | 
			
		||||
# INCLUDES targets sudbirs!
 | 
			
		||||
INCLUDES=	-I.. -I../.. -I../asn1 -I../evp -I../../include
 | 
			
		||||
INCLUDES=	-I.. -I../.. -I../asn1 -I../evp -I../../include $(ZLIB_INCLUDE)
 | 
			
		||||
CFLAG=		-g
 | 
			
		||||
MAKEDEPPROG=	makedepend
 | 
			
		||||
MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 | 
			
		||||
 
 | 
			
		||||
@@ -243,7 +243,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
 | 
			
		||||
		p=OPENSSL_malloc(len);
 | 
			
		||||
		if (p == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_GENERALIZEDTIME_SET,
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_GENERALIZEDTIME_ADJ,
 | 
			
		||||
				ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			return(NULL);
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
@@ -112,7 +112,7 @@ ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t,
 | 
			
		||||
	ts=OPENSSL_gmtime(&t,&data);
 | 
			
		||||
	if (ts == NULL)
 | 
			
		||||
		{
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_TIME_SET, ASN1_R_ERROR_GETTING_TIME);
 | 
			
		||||
		ASN1err(ASN1_F_ASN1_TIME_ADJ, ASN1_R_ERROR_GETTING_TIME);
 | 
			
		||||
		return NULL;
 | 
			
		||||
		}
 | 
			
		||||
	if (offset_day || offset_sec)
 | 
			
		||||
@@ -180,6 +180,7 @@ int ASN1_TIME_set_string(ASN1_TIME *s, const char *str)
 | 
			
		||||
 | 
			
		||||
	t.length = strlen(str);
 | 
			
		||||
	t.data = (unsigned char *)str;
 | 
			
		||||
	t.flags = 0;
 | 
			
		||||
	
 | 
			
		||||
	t.type = V_ASN1_UTCTIME;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -221,7 +221,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
 | 
			
		||||
		p=OPENSSL_malloc(len);
 | 
			
		||||
		if (p == NULL)
 | 
			
		||||
			{
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_UTCTIME_SET,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			ASN1err(ASN1_F_ASN1_UTCTIME_ADJ,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			return(NULL);
 | 
			
		||||
			}
 | 
			
		||||
		if (s->data != NULL)
 | 
			
		||||
 
 | 
			
		||||
@@ -1172,6 +1172,7 @@ void ERR_load_ASN1_strings(void);
 | 
			
		||||
#define ASN1_F_ASN1_ENUMERATED_TO_BN			 113
 | 
			
		||||
#define ASN1_F_ASN1_EX_C2I				 204
 | 
			
		||||
#define ASN1_F_ASN1_FIND_END				 190
 | 
			
		||||
#define ASN1_F_ASN1_GENERALIZEDTIME_ADJ			 216
 | 
			
		||||
#define ASN1_F_ASN1_GENERALIZEDTIME_SET			 185
 | 
			
		||||
#define ASN1_F_ASN1_GENERATE_V3				 178
 | 
			
		||||
#define ASN1_F_ASN1_GET_OBJECT				 114
 | 
			
		||||
@@ -1206,10 +1207,12 @@ void ERR_load_ASN1_strings(void);
 | 
			
		||||
#define ASN1_F_ASN1_TEMPLATE_EX_D2I			 132
 | 
			
		||||
#define ASN1_F_ASN1_TEMPLATE_NEW			 133
 | 
			
		||||
#define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I			 131
 | 
			
		||||
#define ASN1_F_ASN1_TIME_ADJ				 217
 | 
			
		||||
#define ASN1_F_ASN1_TIME_SET				 175
 | 
			
		||||
#define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING		 134
 | 
			
		||||
#define ASN1_F_ASN1_TYPE_GET_OCTETSTRING		 135
 | 
			
		||||
#define ASN1_F_ASN1_UNPACK_STRING			 136
 | 
			
		||||
#define ASN1_F_ASN1_UTCTIME_ADJ				 218
 | 
			
		||||
#define ASN1_F_ASN1_UTCTIME_SET				 187
 | 
			
		||||
#define ASN1_F_ASN1_VERIFY				 137
 | 
			
		||||
#define ASN1_F_B64_READ_ASN1				 209
 | 
			
		||||
@@ -1278,7 +1281,7 @@ void ERR_load_ASN1_strings(void);
 | 
			
		||||
#define ASN1_R_BAD_OBJECT_HEADER			 102
 | 
			
		||||
#define ASN1_R_BAD_PASSWORD_READ			 103
 | 
			
		||||
#define ASN1_R_BAD_TAG					 104
 | 
			
		||||
#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH		 210
 | 
			
		||||
#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH		 214
 | 
			
		||||
#define ASN1_R_BN_LIB					 105
 | 
			
		||||
#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH			 106
 | 
			
		||||
#define ASN1_R_BUFFER_TOO_SMALL				 107
 | 
			
		||||
@@ -1370,7 +1373,7 @@ void ERR_load_ASN1_strings(void);
 | 
			
		||||
#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY			 157
 | 
			
		||||
#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY		 158
 | 
			
		||||
#define ASN1_R_UNEXPECTED_EOC				 159
 | 
			
		||||
#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH		 211
 | 
			
		||||
#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH		 215
 | 
			
		||||
#define ASN1_R_UNKNOWN_FORMAT				 160
 | 
			
		||||
#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM		 161
 | 
			
		||||
#define ASN1_R_UNKNOWN_OBJECT_TYPE			 162
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
/* crypto/asn1/asn1_err.c */
 | 
			
		||||
/* ====================================================================
 | 
			
		||||
 * Copyright (c) 1999-2007 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 * Copyright (c) 1999-2008 The OpenSSL Project.  All rights reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * Redistribution and use in source and binary forms, with or without
 | 
			
		||||
 * modification, are permitted provided that the following conditions
 | 
			
		||||
@@ -90,6 +90,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_ENUMERATED_TO_BN),	"ASN1_ENUMERATED_to_BN"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_EX_C2I),	"ASN1_EX_C2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_FIND_END),	"ASN1_FIND_END"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_GENERALIZEDTIME_ADJ),	"ASN1_GENERALIZEDTIME_adj"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_GENERALIZEDTIME_SET),	"ASN1_GENERALIZEDTIME_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_GENERATE_V3),	"ASN1_generate_v3"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_GET_OBJECT),	"ASN1_get_object"},
 | 
			
		||||
@@ -124,10 +125,12 @@ static ERR_STRING_DATA ASN1_str_functs[]=
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_EX_D2I),	"ASN1_TEMPLATE_EX_D2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_NEW),	"ASN1_TEMPLATE_NEW"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I),	"ASN1_TEMPLATE_NOEXP_D2I"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TIME_ADJ),	"ASN1_TIME_adj"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TIME_SET),	"ASN1_TIME_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING),	"ASN1_TYPE_get_int_octetstring"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_TYPE_GET_OCTETSTRING),	"ASN1_TYPE_get_octetstring"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_UNPACK_STRING),	"ASN1_unpack_string"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_UTCTIME_ADJ),	"ASN1_UTCTIME_adj"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_UTCTIME_SET),	"ASN1_UTCTIME_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_ASN1_VERIFY),	"ASN1_verify"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_B64_READ_ASN1),	"B64_READ_ASN1"},
 | 
			
		||||
@@ -176,7 +179,7 @@ static ERR_STRING_DATA ASN1_str_functs[]=
 | 
			
		||||
{ERR_FUNC(ASN1_F_PKCS5_PBE2_SET_IV),	"PKCS5_pbe2_set_iv"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_PKCS5_PBE_SET),	"PKCS5_pbe_set"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_PKCS5_PBE_SET0_ALGOR),	"PKCS5_pbe_set0_algor"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_SMIME_READ_ASN1),	"SMIME_read_asn1"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_SMIME_READ_ASN1),	"SMIME_read_ASN1"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_SMIME_TEXT),	"SMIME_text"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_CINF_NEW),	"X509_CINF_NEW"},
 | 
			
		||||
{ERR_FUNC(ASN1_F_X509_CRL_ADD0_REVOKED),	"X509_CRL_add0_revoked"},
 | 
			
		||||
 
 | 
			
		||||
@@ -732,9 +732,9 @@ again:
 | 
			
		||||
#endif
 | 
			
		||||
				if (client.sa_family == AF_INET)
 | 
			
		||||
					{
 | 
			
		||||
					struct sockaddr_in *sin6 =
 | 
			
		||||
					struct sockaddr_in *sin4 =
 | 
			
		||||
						(struct sockaddr_in *)&client;
 | 
			
		||||
					sin6->sin_addr.s_addr=htonl(0x7F000001);
 | 
			
		||||
					sin4->sin_addr.s_addr=htonl(0x7F000001);
 | 
			
		||||
					}
 | 
			
		||||
				else	goto err;
 | 
			
		||||
				}
 | 
			
		||||
@@ -808,18 +808,18 @@ int BIO_accept(int sock, char **addr)
 | 
			
		||||
	if (addr == NULL) goto end;
 | 
			
		||||
 | 
			
		||||
#ifdef EAI_FAMILY
 | 
			
		||||
# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_BEOS_BONE) || defined(OPENSSL_SYS_MSDOS)
 | 
			
		||||
#  define SOCKLEN_T size_t
 | 
			
		||||
# else
 | 
			
		||||
#  define SOCKLEN_T socklen_t
 | 
			
		||||
#endif
 | 
			
		||||
	do {
 | 
			
		||||
	char   h[NI_MAXHOST],s[NI_MAXSERV];
 | 
			
		||||
	size_t nl;
 | 
			
		||||
	static union {	void *p;
 | 
			
		||||
			int (*f)(const struct sockaddr *,SOCKLEN_T,
 | 
			
		||||
			int (*f)(const struct sockaddr *,size_t/*socklen_t*/,
 | 
			
		||||
				 char *,size_t,char *,size_t,int);
 | 
			
		||||
			} p_getnameinfo = {NULL};
 | 
			
		||||
			/* 2nd argument to getnameinfo is specified to
 | 
			
		||||
			 * be socklen_t. Unfortunately there is a number
 | 
			
		||||
			 * of environments where socklen_t is not defined.
 | 
			
		||||
			 * As it's passed by value, it's safe to pass it
 | 
			
		||||
			 * as size_t... <appro> */
 | 
			
		||||
 | 
			
		||||
	if (p_getnameinfo.p==NULL)
 | 
			
		||||
		{
 | 
			
		||||
 
 | 
			
		||||
@@ -159,6 +159,8 @@ extern "C" {
 | 
			
		||||
 | 
			
		||||
#define BIO_CTRL_DGRAM_SET_PEER           44 /* Destination for the data */
 | 
			
		||||
 | 
			
		||||
#define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT   45 /* Next DTLS handshake timeout to
 | 
			
		||||
											  * adjust socket timeouts */
 | 
			
		||||
 | 
			
		||||
/* modifiers */
 | 
			
		||||
#define BIO_FP_READ		0x02
 | 
			
		||||
@@ -409,7 +411,7 @@ typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen, void *parg);
 | 
			
		||||
#define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name)
 | 
			
		||||
#define BIO_get_accept_port(b)	BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0)
 | 
			
		||||
/* #define BIO_set_nbio(b,n)	BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */
 | 
			
		||||
#define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?"a":NULL)
 | 
			
		||||
#define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?(void *)"a":NULL)
 | 
			
		||||
#define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio)
 | 
			
		||||
 | 
			
		||||
#define BIO_BIND_NORMAL			0
 | 
			
		||||
 
 | 
			
		||||
@@ -18,11 +18,19 @@
 | 
			
		||||
#define	UP_ftell	ftell
 | 
			
		||||
#define	UP_fflush	fflush
 | 
			
		||||
#define	UP_ferror	ferror
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
#define	UP_fileno	_fileno
 | 
			
		||||
#define	UP_open		_open
 | 
			
		||||
#define	UP_read		_read
 | 
			
		||||
#define	UP_write	_write
 | 
			
		||||
#define	UP_lseek	_lseek
 | 
			
		||||
#define	UP_close	_close
 | 
			
		||||
#else
 | 
			
		||||
#define	UP_fileno	fileno
 | 
			
		||||
 | 
			
		||||
#define	UP_open		open
 | 
			
		||||
#define	UP_read		read
 | 
			
		||||
#define	UP_write	write
 | 
			
		||||
#define	UP_lseek	lseek
 | 
			
		||||
#define	UP_close	close
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -429,7 +429,7 @@ BIO *BIO_push(BIO *b, BIO *bio)
 | 
			
		||||
	if (bio != NULL)
 | 
			
		||||
		bio->prev_bio=lb;
 | 
			
		||||
	/* called to do internal processing */
 | 
			
		||||
	BIO_ctrl(b,BIO_CTRL_PUSH,0,NULL);
 | 
			
		||||
	BIO_ctrl(b,BIO_CTRL_PUSH,0,lb);
 | 
			
		||||
	return(b);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -441,7 +441,7 @@ BIO *BIO_pop(BIO *b)
 | 
			
		||||
	if (b == NULL) return(NULL);
 | 
			
		||||
	ret=b->next_bio;
 | 
			
		||||
 | 
			
		||||
	BIO_ctrl(b,BIO_CTRL_POP,0,NULL);
 | 
			
		||||
	BIO_ctrl(b,BIO_CTRL_POP,0,b);
 | 
			
		||||
 | 
			
		||||
	if (b->prev_bio != NULL)
 | 
			
		||||
		b->prev_bio->next_bio=b->next_bio;
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,13 @@
 | 
			
		||||
 | 
			
		||||
#include <openssl/bio.h>
 | 
			
		||||
 | 
			
		||||
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS)
 | 
			
		||||
#include <sys/timeb.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef OPENSSL_SYS_LINUX
 | 
			
		||||
#define IP_MTU      14 /* linux is lame */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifdef WATT32
 | 
			
		||||
#define sock_write SockWrite  /* Watt-32 uses same names */
 | 
			
		||||
@@ -84,6 +90,8 @@ static int dgram_clear(BIO *bio);
 | 
			
		||||
 | 
			
		||||
static int BIO_dgram_should_retry(int s);
 | 
			
		||||
 | 
			
		||||
static void get_current_time(struct timeval *t);
 | 
			
		||||
 | 
			
		||||
static BIO_METHOD methods_dgramp=
 | 
			
		||||
	{
 | 
			
		||||
	BIO_TYPE_DGRAM,
 | 
			
		||||
@@ -104,6 +112,8 @@ typedef struct bio_dgram_data_st
 | 
			
		||||
	unsigned int connected;
 | 
			
		||||
	unsigned int _errno;
 | 
			
		||||
	unsigned int mtu;
 | 
			
		||||
	struct timeval next_timeout;
 | 
			
		||||
	struct timeval socket_timeout;
 | 
			
		||||
	} bio_dgram_data;
 | 
			
		||||
 | 
			
		||||
BIO_METHOD *BIO_s_datagram(void)
 | 
			
		||||
@@ -166,6 +176,94 @@ static int dgram_clear(BIO *a)
 | 
			
		||||
	return(1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static void dgram_adjust_rcv_timeout(BIO *b)
 | 
			
		||||
	{
 | 
			
		||||
#if defined(SO_RCVTIMEO)
 | 
			
		||||
	bio_dgram_data *data = (bio_dgram_data *)b->ptr;
 | 
			
		||||
	int sz = sizeof(int);
 | 
			
		||||
 | 
			
		||||
	/* Is a timer active? */
 | 
			
		||||
	if (data->next_timeout.tv_sec > 0 || data->next_timeout.tv_usec > 0)
 | 
			
		||||
		{
 | 
			
		||||
		struct timeval timenow, timeleft;
 | 
			
		||||
 | 
			
		||||
		/* Read current socket timeout */
 | 
			
		||||
#ifdef OPENSSL_SYS_WINDOWS
 | 
			
		||||
		int timeout;
 | 
			
		||||
		if (getsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO,
 | 
			
		||||
					   (void*)&timeout, &sz) < 0)
 | 
			
		||||
			{ perror("getsockopt"); }
 | 
			
		||||
		else
 | 
			
		||||
			{
 | 
			
		||||
			data->socket_timeout.tv_sec = timeout / 1000;
 | 
			
		||||
			data->socket_timeout.tv_usec = (timeout % 1000) * 1000;
 | 
			
		||||
			}
 | 
			
		||||
#else
 | 
			
		||||
		if ( getsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, 
 | 
			
		||||
						&(data->socket_timeout), (void *)&sz) < 0)
 | 
			
		||||
			{ perror("getsockopt"); }
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
		/* Get current time */
 | 
			
		||||
		get_current_time(&timenow);
 | 
			
		||||
 | 
			
		||||
		/* Calculate time left until timer expires */
 | 
			
		||||
		memcpy(&timeleft, &(data->next_timeout), sizeof(struct timeval));
 | 
			
		||||
		timeleft.tv_sec -= timenow.tv_sec;
 | 
			
		||||
		timeleft.tv_usec -= timenow.tv_usec;
 | 
			
		||||
		if (timeleft.tv_usec < 0)
 | 
			
		||||
			{
 | 
			
		||||
			timeleft.tv_sec--;
 | 
			
		||||
			timeleft.tv_usec += 1000000;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (timeleft.tv_sec < 0)
 | 
			
		||||
			{
 | 
			
		||||
			timeleft.tv_sec = 0;
 | 
			
		||||
			timeleft.tv_usec = 1;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		/* Adjust socket timeout if next handhake message timer
 | 
			
		||||
		 * will expire earlier.
 | 
			
		||||
		 */
 | 
			
		||||
		if ((data->socket_timeout.tv_sec == 0 && data->socket_timeout.tv_usec == 0) ||
 | 
			
		||||
			(data->socket_timeout.tv_sec > timeleft.tv_sec) ||
 | 
			
		||||
			(data->socket_timeout.tv_sec == timeleft.tv_sec &&
 | 
			
		||||
			 data->socket_timeout.tv_usec >= timeleft.tv_usec))
 | 
			
		||||
			{
 | 
			
		||||
#ifdef OPENSSL_SYS_WINDOWS
 | 
			
		||||
			timeout = timeleft.tv_sec * 1000 + timeleft.tv_usec / 1000;
 | 
			
		||||
			if (setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO,
 | 
			
		||||
						   (void*)&timeout, sizeof(timeout)) < 0)
 | 
			
		||||
				{ perror("setsockopt"); }
 | 
			
		||||
#else
 | 
			
		||||
			if ( setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, &timeleft,
 | 
			
		||||
							sizeof(struct timeval)) < 0)
 | 
			
		||||
				{ perror("setsockopt"); }
 | 
			
		||||
#endif
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static void dgram_reset_rcv_timeout(BIO *b)
 | 
			
		||||
	{
 | 
			
		||||
#if defined(SO_RCVTIMEO)
 | 
			
		||||
	bio_dgram_data *data = (bio_dgram_data *)b->ptr;
 | 
			
		||||
#ifdef OPENSSL_SYS_WINDOWS
 | 
			
		||||
	int timeout = data->socket_timeout.tv_sec * 1000 +
 | 
			
		||||
				  data->socket_timeout.tv_usec / 1000;
 | 
			
		||||
	if (setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO,
 | 
			
		||||
				   (void*)&timeout, sizeof(timeout)) < 0)
 | 
			
		||||
		{ perror("setsockopt"); }
 | 
			
		||||
#else
 | 
			
		||||
	if ( setsockopt(b->num, SOL_SOCKET, SO_RCVTIMEO, &(data->socket_timeout),
 | 
			
		||||
					sizeof(struct timeval)) < 0)
 | 
			
		||||
		{ perror("setsockopt"); }
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
static int dgram_read(BIO *b, char *out, int outl)
 | 
			
		||||
	{
 | 
			
		||||
	int ret=0;
 | 
			
		||||
@@ -183,7 +281,9 @@ static int dgram_read(BIO *b, char *out, int outl)
 | 
			
		||||
		 * but this is not universal. Cast to (void *) to avoid
 | 
			
		||||
		 * compiler warnings.
 | 
			
		||||
		 */
 | 
			
		||||
		dgram_adjust_rcv_timeout(b);
 | 
			
		||||
		ret=recvfrom(b->num,out,outl,0,&peer,(void *)&peerlen);
 | 
			
		||||
		dgram_reset_rcv_timeout(b);
 | 
			
		||||
 | 
			
		||||
		if ( ! data->connected  && ret > 0)
 | 
			
		||||
			BIO_ctrl(b, BIO_CTRL_DGRAM_CONNECT, 0, &peer);
 | 
			
		||||
@@ -240,8 +340,14 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
	int *ip;
 | 
			
		||||
	struct sockaddr *to = NULL;
 | 
			
		||||
	bio_dgram_data *data = NULL;
 | 
			
		||||
#if defined(IP_MTU_DISCOVER) || defined(IP_MTU)
 | 
			
		||||
	long sockopt_val = 0;
 | 
			
		||||
	unsigned int sockopt_len = 0;
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef OPENSSL_SYS_LINUX
 | 
			
		||||
	socklen_t addr_len;
 | 
			
		||||
	struct sockaddr_storage addr;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
	data = (bio_dgram_data *)b->ptr;
 | 
			
		||||
 | 
			
		||||
@@ -300,24 +406,87 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
#endif
 | 
			
		||||
		break;
 | 
			
		||||
		/* (Linux)kernel sets DF bit on outgoing IP packets */
 | 
			
		||||
#ifdef IP_MTU_DISCOVER
 | 
			
		||||
	case BIO_CTRL_DGRAM_MTU_DISCOVER:
 | 
			
		||||
		sockopt_val = IP_PMTUDISC_DO;
 | 
			
		||||
		if ((ret = setsockopt(b->num, IPPROTO_IP, IP_MTU_DISCOVER,
 | 
			
		||||
			&sockopt_val, sizeof(sockopt_val))) < 0)
 | 
			
		||||
			perror("setsockopt");
 | 
			
		||||
#ifdef OPENSSL_SYS_LINUX
 | 
			
		||||
		addr_len = (socklen_t)sizeof(struct sockaddr_storage);
 | 
			
		||||
		memset((void *)&addr, 0, sizeof(struct sockaddr_storage));
 | 
			
		||||
		if (getsockname(b->num, (void *)&addr, &addr_len) < 0)
 | 
			
		||||
			{
 | 
			
		||||
			ret = 0;
 | 
			
		||||
			break;
 | 
			
		||||
			}
 | 
			
		||||
		sockopt_len = sizeof(sockopt_val);
 | 
			
		||||
		switch (addr.ss_family)
 | 
			
		||||
			{
 | 
			
		||||
		case AF_INET:
 | 
			
		||||
			sockopt_val = IP_PMTUDISC_DO;
 | 
			
		||||
			if ((ret = setsockopt(b->num, IPPROTO_IP, IP_MTU_DISCOVER,
 | 
			
		||||
				&sockopt_val, sizeof(sockopt_val))) < 0)
 | 
			
		||||
				perror("setsockopt");
 | 
			
		||||
			break;
 | 
			
		||||
		case AF_INET6:
 | 
			
		||||
			sockopt_val = IPV6_PMTUDISC_DO;
 | 
			
		||||
			if ((ret = setsockopt(b->num, IPPROTO_IPV6, IPV6_MTU_DISCOVER,
 | 
			
		||||
				&sockopt_val, sizeof(sockopt_val))) < 0)
 | 
			
		||||
				perror("setsockopt");
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			ret = -1;
 | 
			
		||||
			break;
 | 
			
		||||
			}
 | 
			
		||||
		ret = -1;
 | 
			
		||||
#else
 | 
			
		||||
		break;
 | 
			
		||||
#endif
 | 
			
		||||
	case BIO_CTRL_DGRAM_QUERY_MTU:
 | 
			
		||||
         sockopt_len = sizeof(sockopt_val);
 | 
			
		||||
		if ((ret = getsockopt(b->num, IPPROTO_IP, IP_MTU, (void *)&sockopt_val,
 | 
			
		||||
			&sockopt_len)) < 0 || sockopt_val < 0)
 | 
			
		||||
			{ ret = 0; }
 | 
			
		||||
		else
 | 
			
		||||
#ifdef OPENSSL_SYS_LINUX
 | 
			
		||||
		addr_len = (socklen_t)sizeof(struct sockaddr_storage);
 | 
			
		||||
		memset((void *)&addr, 0, sizeof(struct sockaddr_storage));
 | 
			
		||||
		if (getsockname(b->num, (void *)&addr, &addr_len) < 0)
 | 
			
		||||
			{
 | 
			
		||||
			data->mtu = sockopt_val;
 | 
			
		||||
			ret = data->mtu;
 | 
			
		||||
			ret = 0;
 | 
			
		||||
			break;
 | 
			
		||||
			}
 | 
			
		||||
		sockopt_len = sizeof(sockopt_val);
 | 
			
		||||
		switch (addr.ss_family)
 | 
			
		||||
			{
 | 
			
		||||
		case AF_INET:
 | 
			
		||||
			if ((ret = getsockopt(b->num, IPPROTO_IP, IP_MTU, (void *)&sockopt_val,
 | 
			
		||||
				&sockopt_len)) < 0 || sockopt_val < 0)
 | 
			
		||||
				{
 | 
			
		||||
				ret = 0;
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
				/* we assume that the transport protocol is UDP and no
 | 
			
		||||
				 * IP options are used.
 | 
			
		||||
				 */
 | 
			
		||||
				data->mtu = sockopt_val - 8 - 20;
 | 
			
		||||
				ret = data->mtu;
 | 
			
		||||
				}
 | 
			
		||||
			break;
 | 
			
		||||
		case AF_INET6:
 | 
			
		||||
			if ((ret = getsockopt(b->num, IPPROTO_IPV6, IPV6_MTU, (void *)&sockopt_val,
 | 
			
		||||
				&sockopt_len)) < 0 || sockopt_val < 0)
 | 
			
		||||
				{
 | 
			
		||||
				ret = 0;
 | 
			
		||||
				}
 | 
			
		||||
			else
 | 
			
		||||
				{
 | 
			
		||||
				/* we assume that the transport protocol is UDP and no
 | 
			
		||||
				 * IPV6 options are used.
 | 
			
		||||
				 */
 | 
			
		||||
				data->mtu = sockopt_val - 8 - 40;
 | 
			
		||||
				ret = data->mtu;
 | 
			
		||||
				}
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			ret = 0;
 | 
			
		||||
			break;
 | 
			
		||||
			}
 | 
			
		||||
#else
 | 
			
		||||
		ret = 0;
 | 
			
		||||
#endif
 | 
			
		||||
		break;
 | 
			
		||||
	case BIO_CTRL_DGRAM_GET_MTU:
 | 
			
		||||
		return data->mtu;
 | 
			
		||||
@@ -345,6 +514,9 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
 | 
			
		||||
 | 
			
		||||
        memcpy(&(data->peer), to, sizeof(struct sockaddr));
 | 
			
		||||
        break;
 | 
			
		||||
	case BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT:
 | 
			
		||||
		memcpy(&(data->next_timeout), ptr, sizeof(struct timeval));		
 | 
			
		||||
		break;
 | 
			
		||||
#if defined(SO_RCVTIMEO)
 | 
			
		||||
	case BIO_CTRL_DGRAM_SET_RECV_TIMEOUT:
 | 
			
		||||
#ifdef OPENSSL_SYS_WINDOWS
 | 
			
		||||
@@ -546,3 +718,20 @@ int BIO_dgram_non_fatal_error(int err)
 | 
			
		||||
	return(0);
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static void get_current_time(struct timeval *t)
 | 
			
		||||
	{
 | 
			
		||||
#ifdef OPENSSL_SYS_WIN32
 | 
			
		||||
	struct _timeb tb;
 | 
			
		||||
	_ftime(&tb);
 | 
			
		||||
	t->tv_sec = (long)tb.time;
 | 
			
		||||
	t->tv_usec = (long)tb.millitm * 1000;
 | 
			
		||||
#elif defined(OPENSSL_SYS_VMS)
 | 
			
		||||
	struct timeb tb;
 | 
			
		||||
	ftime(&tb);
 | 
			
		||||
	t->tv_sec = (long)tb.time;
 | 
			
		||||
	t->tv_usec = (long)tb.millitm * 1000;
 | 
			
		||||
#else
 | 
			
		||||
	gettimeofday(t, NULL);
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -161,7 +161,7 @@ static void ctxdbg(BN_CTX *ctx)
 | 
			
		||||
	fprintf(stderr,"(%08x): ", (unsigned int)ctx);
 | 
			
		||||
	while(bnidx < ctx->used)
 | 
			
		||||
		{
 | 
			
		||||
		fprintf(stderr,"%02x ", item->vals[bnidx++ % BN_CTX_POOL_SIZE].dmax);
 | 
			
		||||
		fprintf(stderr,"%03x ", item->vals[bnidx++ % BN_CTX_POOL_SIZE].dmax);
 | 
			
		||||
		if(!(bnidx % BN_CTX_POOL_SIZE))
 | 
			
		||||
			item = item->next;
 | 
			
		||||
		}
 | 
			
		||||
@@ -171,8 +171,8 @@ static void ctxdbg(BN_CTX *ctx)
 | 
			
		||||
	while(fpidx < stack->depth)
 | 
			
		||||
		{
 | 
			
		||||
		while(bnidx++ < stack->indexes[fpidx])
 | 
			
		||||
			fprintf(stderr,"   ");
 | 
			
		||||
		fprintf(stderr,"^^ ");
 | 
			
		||||
			fprintf(stderr,"    ");
 | 
			
		||||
		fprintf(stderr,"^^^ ");
 | 
			
		||||
		bnidx++;
 | 
			
		||||
		fpidx++;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -229,7 +229,8 @@ int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
 | 
			
		||||
	if (dv == NULL)
 | 
			
		||||
		res=BN_CTX_get(ctx);
 | 
			
		||||
	else	res=dv;
 | 
			
		||||
	if (sdiv == NULL || res == NULL) goto err;
 | 
			
		||||
	if (sdiv == NULL || res == NULL || tmp == NULL || snum == NULL)
 | 
			
		||||
		goto err;
 | 
			
		||||
 | 
			
		||||
	/* First we normalise the numbers */
 | 
			
		||||
	norm_shift=BN_BITS2-((BN_num_bits(divisor))%BN_BITS2);
 | 
			
		||||
 
 | 
			
		||||
@@ -134,7 +134,8 @@ int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx)
 | 
			
		||||
		rr = BN_CTX_get(ctx);
 | 
			
		||||
	else
 | 
			
		||||
		rr = r;
 | 
			
		||||
	if ((v = BN_CTX_get(ctx)) == NULL) goto err;
 | 
			
		||||
	v = BN_CTX_get(ctx);
 | 
			
		||||
	if (rr == NULL || v == NULL) goto err;
 | 
			
		||||
 | 
			
		||||
	if (BN_copy(v,a) == NULL) goto err;
 | 
			
		||||
	bits=BN_num_bits(p);
 | 
			
		||||
 
 | 
			
		||||
@@ -1028,6 +1028,8 @@ int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx)
 | 
			
		||||
			assert(j <= al || j <= bl);
 | 
			
		||||
			k = j+j;
 | 
			
		||||
			t = BN_CTX_get(ctx);
 | 
			
		||||
			if (t == NULL)
 | 
			
		||||
				goto err;
 | 
			
		||||
			if (al > j || bl > j)
 | 
			
		||||
				{
 | 
			
		||||
				bn_wexpand(t,k*4);
 | 
			
		||||
 
 | 
			
		||||
@@ -1133,6 +1133,6 @@ my ($s0,$s1,$s2,$s3) = @T;
 | 
			
		||||
&function_end("Camellia_cbc_encrypt");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
&asciz("Camellia for x86 by <appro@openssl.org>");
 | 
			
		||||
&asciz("Camellia for x86 by <appro\@openssl.org>");
 | 
			
		||||
 | 
			
		||||
&asm_finish();
 | 
			
		||||
 
 | 
			
		||||
@@ -859,7 +859,7 @@ Camellia_cbc_encrypt:
 | 
			
		||||
	ret
 | 
			
		||||
.size	Camellia_cbc_encrypt,.-Camellia_cbc_encrypt
 | 
			
		||||
 | 
			
		||||
.asciz	"Camellia for x86_64 by <appro@openssl.org>"
 | 
			
		||||
.asciz	"Camellia for x86_64 by <appro\@openssl.org>"
 | 
			
		||||
___
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -91,10 +91,24 @@
 | 
			
		||||
# if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))
 | 
			
		||||
#  define RightRotate(x, s) _lrotr(x, s)
 | 
			
		||||
#  define LeftRotate(x, s)  _lrotl(x, s)
 | 
			
		||||
#  if _MSC_VER >= 1400
 | 
			
		||||
#   define SWAP(x) _byteswap_ulong(x)
 | 
			
		||||
#  else
 | 
			
		||||
#   define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)
 | 
			
		||||
#  endif
 | 
			
		||||
#  define GETU32(p)   SWAP(*((u32 *)(p)))
 | 
			
		||||
#  define PUTU32(p,v) (*((u32 *)(p)) = SWAP((v)))
 | 
			
		||||
# elif defined(__GNUC__) && __GNUC__>=2
 | 
			
		||||
#  if defined(__i386) || defined(__x86_64)
 | 
			
		||||
#   define RightRotate(x,s) ({u32 ret; asm ("rorl %1,%0":"=r"(ret):"I"(s),"0"(x):"cc"); ret; })
 | 
			
		||||
#   define LeftRotate(x,s)  ({u32 ret; asm ("roll %1,%0":"=r"(ret):"I"(s),"0"(x):"cc"); ret; })
 | 
			
		||||
#   if defined(B_ENDIAN) /* stratus.com does it */
 | 
			
		||||
#    define GETU32(p)   (*(u32 *)(p))
 | 
			
		||||
#    define PUTU32(p,v) (*(u32 *)(p)=(v))
 | 
			
		||||
#   else
 | 
			
		||||
#    define GETU32(p)   ({u32 r=*(const u32 *)(p); asm("bswapl %0":"=r"(r):"0"(r)); r; })
 | 
			
		||||
#    define PUTU32(p,v) ({u32 r=(v); asm("bswapl %0":"=r"(r):"0"(r)); *(u32 *)(p)=r; })
 | 
			
		||||
#   endif
 | 
			
		||||
#  elif defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \
 | 
			
		||||
        defined(__powerpc) || defined(__ppc__) || defined(__powerpc64__)
 | 
			
		||||
#   define LeftRotate(x,s)  ({u32 ret; asm ("rlwinm %0,%1,%2,0,31":"=r"(ret):"r"(x),"I"(s)); ret; })
 | 
			
		||||
@@ -102,13 +116,20 @@
 | 
			
		||||
#  elif defined(__s390x__)
 | 
			
		||||
#   define LeftRotate(x,s)  ({u32 ret; asm ("rll %0,%1,%2":"=r"(ret):"r"(x),"I"(s)); ret; })
 | 
			
		||||
#   define RightRotate(x,s) LeftRotate(x,(32-s))
 | 
			
		||||
#   define GETU32(p)   (*(u32 *)(p))
 | 
			
		||||
#   define PUTU32(p,v) (*(u32 *)(p)=(v))
 | 
			
		||||
#  endif
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(RightRotate) && !defined(LeftRotate)
 | 
			
		||||
#define RightRotate(x, s) ( ((x) >> (s)) + ((x) << (32 - s)) )
 | 
			
		||||
#define LeftRotate(x, s)  ( ((x) << (s)) + ((x) >> (32 - s)) )
 | 
			
		||||
# define RightRotate(x, s) ( ((x) >> (s)) + ((x) << (32 - s)) )
 | 
			
		||||
# define LeftRotate(x, s)  ( ((x) << (s)) + ((x) >> (32 - s)) )
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if !defined(GETU32) && !defined(PUTU32)
 | 
			
		||||
# define GETU32(p)   (((u32)(p)[0] << 24) ^ ((u32)(p)[1] << 16) ^ ((u32)(p)[2] <<  8) ^ ((u32)(p)[3]))
 | 
			
		||||
# define PUTU32(p,v) ((p)[0] = (u8)((v) >> 24), (p)[1] = (u8)((v) >> 16), (p)[2] = (u8)((v) >>  8), (p)[3] = (u8)(v))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* S-box data */
 | 
			
		||||
 
 | 
			
		||||
@@ -71,30 +71,6 @@
 | 
			
		||||
typedef unsigned int  u32;
 | 
			
		||||
typedef unsigned char u8;
 | 
			
		||||
 | 
			
		||||
#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))
 | 
			
		||||
# if _MSC_VER >= 1400
 | 
			
		||||
#  define SWAP(x) _byteswap_ulong(x)
 | 
			
		||||
# else
 | 
			
		||||
#  define SWAP(x) (_lrotl(x, 8) & 0x00ff00ff | _lrotr(x, 8) & 0xff00ff00)
 | 
			
		||||
# endif
 | 
			
		||||
# define GETU32(p)   SWAP(*((u32 *)(p)))
 | 
			
		||||
# define PUTU32(p,v) (*((u32 *)(p)) = SWAP((v)))
 | 
			
		||||
#elif defined(__GNUC__) && __GNUC__>=2 && (defined(__i386) || defined(__x86_64)) && !defined(PEDANTIC)
 | 
			
		||||
# if defined(B_ENDIAN) /* stratus.com does it */
 | 
			
		||||
#  define GETU32(p)   (*(u32 *)(p))
 | 
			
		||||
#  define PUTU32(p,v) (*(u32 *)(p)=(v))
 | 
			
		||||
# else
 | 
			
		||||
#  define GETU32(p)   ({u32 r=*(const u32 *)(p); asm("bswapl %0":"=r"(r):"0"(r)); r; })
 | 
			
		||||
#  define PUTU32(p,v) ({u32 r=(v); asm("bswapl %0":"=r"(r):"0"(r)); *(u32 *)(p)=r; })
 | 
			
		||||
# endif
 | 
			
		||||
#elif defined(__s390__) || defined(__s390x__)
 | 
			
		||||
# define GETU32(p)   (*(u32 *)(p))
 | 
			
		||||
# define PUTU32(p,v) (*(u32 *)(p)=(v))
 | 
			
		||||
#else
 | 
			
		||||
# define GETU32(p)   (((u32)(p)[0] << 24) ^ ((u32)(p)[1] << 16) ^ ((u32)(p)[2] <<  8) ^ ((u32)(p)[3]))
 | 
			
		||||
# define PUTU32(p,v) ((p)[0] = (u8)((v) >> 24), (p)[1] = (u8)((v) >> 16), (p)[2] = (u8)((v) >>  8), (p)[3] = (u8)(v))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE keyTable);
 | 
			
		||||
void Camellia_EncryptBlock_Rounds(int grandRounds, const u8 plaintext[], 
 | 
			
		||||
		const KEY_TABLE_TYPE keyTable, u8 ciphertext[]);
 | 
			
		||||
 
 | 
			
		||||
@@ -205,7 +205,7 @@ int CRYPTO_get_new_lockid(char *name)
 | 
			
		||||
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16)
 | 
			
		||||
	/* A hack to make Visual C++ 5.0 work correctly when linking as
 | 
			
		||||
	 * a DLL using /MT. Without this, the application cannot use
 | 
			
		||||
	 * and floating point printf's.
 | 
			
		||||
	 * any floating point printf's.
 | 
			
		||||
	 * It also seems to be needed for Visual C 1.5 (win16) */
 | 
			
		||||
	SSLeay_MSVC5_hack=(double)name[0]*(double)name[1];
 | 
			
		||||
#endif
 | 
			
		||||
@@ -659,7 +659,7 @@ const char *CRYPTO_get_lock_name(int type)
 | 
			
		||||
 | 
			
		||||
#if	defined(__i386)   || defined(__i386__)   || defined(_M_IX86) || \
 | 
			
		||||
	defined(__INTEL__) || \
 | 
			
		||||
	defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64)
 | 
			
		||||
	defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) || defined(_M_X64)
 | 
			
		||||
 | 
			
		||||
unsigned long  OPENSSL_ia32cap_P=0;
 | 
			
		||||
unsigned long *OPENSSL_ia32cap_loc(void) { return &OPENSSL_ia32cap_P; }
 | 
			
		||||
@@ -698,6 +698,8 @@ void OPENSSL_cpuid_setup(void) {}
 | 
			
		||||
#ifdef __CYGWIN__
 | 
			
		||||
/* pick DLL_[PROCESS|THREAD]_[ATTACH|DETACH] definitions */
 | 
			
		||||
#include <windows.h>
 | 
			
		||||
/* this has side-effect of _WIN32 getting defined, which otherwise
 | 
			
		||||
 * is mutually exclusive with __CYGWIN__... */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* All we really need to do is remove the 'error' state when a thread
 | 
			
		||||
@@ -740,6 +742,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
 | 
			
		||||
 | 
			
		||||
#if defined(_WIN32) && !defined(__CYGWIN__)
 | 
			
		||||
#include <tchar.h>
 | 
			
		||||
#include <signal.h>
 | 
			
		||||
 | 
			
		||||
#if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
 | 
			
		||||
int OPENSSL_isservice(void)
 | 
			
		||||
@@ -870,7 +873,13 @@ void OpenSSLDie(const char *file,int line,const char *assertion)
 | 
			
		||||
	OPENSSL_showfatal(
 | 
			
		||||
		"%s(%d): OpenSSL internal error, assertion failed: %s\n",
 | 
			
		||||
		file,line,assertion);
 | 
			
		||||
#if !defined(_WIN32) || defined(__CYGWIN__)
 | 
			
		||||
	abort();
 | 
			
		||||
#else
 | 
			
		||||
	/* Win32 abort() customarily shows a dialog, but we just did that... */
 | 
			
		||||
	raise(SIGABRT);
 | 
			
		||||
	_exit(3);
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void *OPENSSL_stderr(void)	{ return stderr; }
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,8 @@ $!
 | 
			
		||||
$!  Changes by Richard Levitte <richard@levitte.org>
 | 
			
		||||
$!
 | 
			
		||||
$!  This command files compiles and creates the "[.xxx.EXE.CRYPTO]LIBCRYPTO.OLB" 
 | 
			
		||||
$!  library for OpenSSL.  The "xxx" denotes the machine architecture of AXP
 | 
			
		||||
$!  or VAX.
 | 
			
		||||
$!  library for OpenSSL.  The "xxx" denotes the machine architecture, ALPHA,
 | 
			
		||||
$!  IA64 or VAX.
 | 
			
		||||
$!
 | 
			
		||||
$!  It was re-written so it would try to determine what "C" compiler to use 
 | 
			
		||||
$!  or you can specify which "C" compiler to use.
 | 
			
		||||
@@ -17,28 +17,28 @@ $!
 | 
			
		||||
$!  Specify the following as P1 to build just that part or ALL to just
 | 
			
		||||
$!  build everything.
 | 
			
		||||
$!
 | 
			
		||||
$!    		LIBRARY    To just compile the [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library.
 | 
			
		||||
$!    		APPS       To just compile the [.xxx.EXE.CRYPTO]*.EXE
 | 
			
		||||
$!		ALL	   To do both LIBRARY and APPS
 | 
			
		||||
$!    	LIBRARY    To just compile the [.xxx.EXE.CRYPTO]LIBCRYPTO.OLB Library.
 | 
			
		||||
$!    	APPS       To just compile the [.xxx.EXE.CRYPTO]*.EXE
 | 
			
		||||
$!	ALL	   To do both LIBRARY and APPS
 | 
			
		||||
$!
 | 
			
		||||
$!  Specify DEBUG or NODEBUG as P2 to compile with or without debugger
 | 
			
		||||
$!  information.
 | 
			
		||||
$!
 | 
			
		||||
$!  Specify which compiler at P3 to try to compile under.
 | 
			
		||||
$!
 | 
			
		||||
$!	   VAXC	 For VAX C.
 | 
			
		||||
$!	   DECC	 For DEC C.
 | 
			
		||||
$!	   GNUC	 For GNU C.
 | 
			
		||||
$!	VAXC	   For VAX C.
 | 
			
		||||
$!	DECC	   For DEC C.
 | 
			
		||||
$!	GNUC	   For GNU C.
 | 
			
		||||
$!
 | 
			
		||||
$!  If you don't speficy a compiler, it will try to determine which
 | 
			
		||||
$!  If you don't specify a compiler, it will try to determine which
 | 
			
		||||
$!  "C" compiler to use.
 | 
			
		||||
$!
 | 
			
		||||
$!  P4, if defined, sets a TCP/IP library to use, through one of the following
 | 
			
		||||
$!  keywords:
 | 
			
		||||
$!
 | 
			
		||||
$!	UCX		for UCX
 | 
			
		||||
$!	TCPIP		for TCPIP (post UCX)
 | 
			
		||||
$!	SOCKETSHR	for SOCKETSHR+NETLIB
 | 
			
		||||
$!	UCX	   For UCX
 | 
			
		||||
$!	TCPIP	   For TCPIP (post UCX)
 | 
			
		||||
$!	SOCKETSHR  For SOCKETSHR+NETLIB
 | 
			
		||||
$!
 | 
			
		||||
$!  P5, if defined, sets a compiler thread NOT needed on OpenVMS 7.1 (and up)
 | 
			
		||||
$!
 | 
			
		||||
@@ -54,26 +54,30 @@ $ TCPIP_LIB = ""
 | 
			
		||||
$!
 | 
			
		||||
$! Check Which Architecture We Are Using.
 | 
			
		||||
$!
 | 
			
		||||
$ IF (F$GETSYI("CPU").GE.128)
 | 
			
		||||
$ IF (F$GETSYI("CPU").LT.128)
 | 
			
		||||
$ THEN
 | 
			
		||||
$!
 | 
			
		||||
$!  The Architecture Is AXP
 | 
			
		||||
$!  The Architecture Is VAX
 | 
			
		||||
$!
 | 
			
		||||
$   ARCH := AXP
 | 
			
		||||
$   ARCH := VAX
 | 
			
		||||
$!
 | 
			
		||||
$! Else...
 | 
			
		||||
$!
 | 
			
		||||
$ ELSE
 | 
			
		||||
$!
 | 
			
		||||
$!  The Architecture Is VAX.
 | 
			
		||||
$!  The Architecture Is Alpha, IA64 or whatever comes in the future.
 | 
			
		||||
$!
 | 
			
		||||
$   ARCH := VAX
 | 
			
		||||
$   ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
 | 
			
		||||
$   IF (ARCH .EQS. "") THEN ARCH = "UNK"
 | 
			
		||||
$!
 | 
			
		||||
$! End The Architecture Check.
 | 
			
		||||
$!
 | 
			
		||||
$ ENDIF
 | 
			
		||||
$!
 | 
			
		||||
$! Define The Different Encryption Types.
 | 
			
		||||
$! NOTE: Some might think this list ugly.  However, it's made this way to
 | 
			
		||||
$! reflect the SDIRS variable in [-]Makefile.org as closely as possible,
 | 
			
		||||
$! thereby making it fairly easy to verify that the lists are the same.
 | 
			
		||||
$!
 | 
			
		||||
$ ENCRYPT_TYPES = "Basic,"+ -
 | 
			
		||||
		  "OBJECTS,"+ -
 | 
			
		||||
@@ -84,6 +88,13 @@ $ ENCRYPT_TYPES = "Basic,"+ -
 | 
			
		||||
		  "EVP,EVP_2,EVP_3,ASN1,ASN1_2,PEM,X509,X509V3,"+ -
 | 
			
		||||
		  "CONF,TXT_DB,PKCS7,PKCS12,COMP,OCSP,UI,KRB5,"+ -
 | 
			
		||||
		  "STORE,CMS,PQUEUE,TS,JPAKE"
 | 
			
		||||
$! Define The OBJ Directory.
 | 
			
		||||
$!
 | 
			
		||||
$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.CRYPTO]
 | 
			
		||||
$!
 | 
			
		||||
$! Define The EXE Directory.
 | 
			
		||||
$!
 | 
			
		||||
$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]
 | 
			
		||||
$!
 | 
			
		||||
$! Check To Make Sure We Have Valid Command Line Parameters.
 | 
			
		||||
$!
 | 
			
		||||
@@ -97,9 +108,6 @@ $! Tell The User What Kind of Machine We Run On.
 | 
			
		||||
$!
 | 
			
		||||
$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
 | 
			
		||||
$!
 | 
			
		||||
$! Define The OBJ Directory.
 | 
			
		||||
$!
 | 
			
		||||
$ OBJ_DIR := SYS$DISK:[-.'ARCH'.OBJ.CRYPTO]
 | 
			
		||||
$!
 | 
			
		||||
$! Check To See If The Architecture Specific OBJ Directory Exists.
 | 
			
		||||
$!
 | 
			
		||||
@@ -114,10 +122,6 @@ $! End The Architecture Specific OBJ Directory Check.
 | 
			
		||||
$!
 | 
			
		||||
$ ENDIF
 | 
			
		||||
$!
 | 
			
		||||
$! Define The EXE Directory.
 | 
			
		||||
$!
 | 
			
		||||
$ EXE_DIR := SYS$DISK:[-.'ARCH'.EXE.CRYPTO]
 | 
			
		||||
$!
 | 
			
		||||
$! Check To See If The Architecture Specific Directory Exists.
 | 
			
		||||
$!
 | 
			
		||||
$ IF (F$PARSE(EXE_DIR).EQS."")
 | 
			
		||||
@@ -299,7 +303,7 @@ $ ! Disable the DOLLARID warning
 | 
			
		||||
$ COMPILEWITH_CC4 = ",a_utctm,bss_log,o_time,o_dir"
 | 
			
		||||
$ ! Disable disjoint optimization
 | 
			
		||||
$ COMPILEWITH_CC5 = ",md2_dgst,md4_dgst,md5_dgst,mdc2dgst," + -
 | 
			
		||||
                    "sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
 | 
			
		||||
                    "seed,sha_dgst,sha1dgst,rmd_dgst,bf_enc,"
 | 
			
		||||
$ ! Disable the MIXLINKAGE warning
 | 
			
		||||
$ COMPILEWITH_CC6 = ",enc_read,set_key,"
 | 
			
		||||
$!
 | 
			
		||||
@@ -342,11 +346,11 @@ $! Create The Library and Apps Module Names.
 | 
			
		||||
$!
 | 
			
		||||
$ LIB_MODULE = "LIB_" + MODULE_NAME
 | 
			
		||||
$ APPS_MODULE = "APPS_" + MODULE_NAME
 | 
			
		||||
$ IF (MODULE_NAME.EQS."ASN1_2")
 | 
			
		||||
$ IF (F$EXTRACT(0,5,MODULE_NAME).EQS."ASN1_")
 | 
			
		||||
$ THEN
 | 
			
		||||
$   MODULE_NAME = "ASN1"
 | 
			
		||||
$ ENDIF
 | 
			
		||||
$ IF (MODULE_NAME.EQS."EVP_2".OR.MODULE_NAME.EQS."EVP_3")
 | 
			
		||||
$ IF (F$EXTRACT(0,4,MODULE_NAME).EQS."EVP_")
 | 
			
		||||
$ THEN
 | 
			
		||||
$   MODULE_NAME = "EVP"
 | 
			
		||||
$ ENDIF
 | 
			
		||||
@@ -702,7 +706,7 @@ $!
 | 
			
		||||
$   IF (F$SEARCH(OPT_FILE).EQS."")
 | 
			
		||||
$   THEN
 | 
			
		||||
$!
 | 
			
		||||
$!    Figure Out If We Need An AXP Or A VAX Linker Option File.
 | 
			
		||||
$!    Figure Out If We Need A non-VAX Or A VAX Linker Option File.
 | 
			
		||||
$!
 | 
			
		||||
$     IF ARCH .EQS. "VAX"
 | 
			
		||||
$     THEN
 | 
			
		||||
@@ -722,19 +726,19 @@ $!    Else...
 | 
			
		||||
$!
 | 
			
		||||
$     ELSE
 | 
			
		||||
$!
 | 
			
		||||
$!      Create The AXP Linker Option File.
 | 
			
		||||
$!      Create The non-VAX Linker Option File.
 | 
			
		||||
$!
 | 
			
		||||
$       CREATE 'OPT_FILE'
 | 
			
		||||
$DECK
 | 
			
		||||
!
 | 
			
		||||
! Default System Options File For AXP To Link Agianst 
 | 
			
		||||
! Default System Options File For non-VAX To Link Agianst 
 | 
			
		||||
! The Sharable C Runtime Library.
 | 
			
		||||
!
 | 
			
		||||
SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
 | 
			
		||||
SYS$SHARE:CMA$OPEN_RTL/SHARE
 | 
			
		||||
$EOD
 | 
			
		||||
$!
 | 
			
		||||
$!    End The VAX/AXP DEC C Option File Check.
 | 
			
		||||
$!    End The DEC C Option File Check.
 | 
			
		||||
$!
 | 
			
		||||
$     ENDIF
 | 
			
		||||
$!
 | 
			
		||||
@@ -795,8 +799,9 @@ $     WRITE SYS$OUTPUT "    APPS     :  To Compile Just The [.xxx.EXE.CRYPTO]*.E
 | 
			
		||||
$     WRITE SYS$OUTPUT ""
 | 
			
		||||
$     WRITE SYS$OUTPUT " Where 'xxx' Stands For:"
 | 
			
		||||
$     WRITE SYS$OUTPUT ""
 | 
			
		||||
$     WRITE SYS$OUTPUT "        AXP  :  Alpha Architecture."
 | 
			
		||||
$     WRITE SYS$OUTPUT "        VAX  :  VAX Architecture."
 | 
			
		||||
$     WRITE SYS$OUTPUT "    ALPHA    :  Alpha Architecture."
 | 
			
		||||
$     WRITE SYS$OUTPUT "    IA64     :  IA64 Architecture."
 | 
			
		||||
$     WRITE SYS$OUTPUT "    VAX      :  VAX Architecture."
 | 
			
		||||
$     WRITE SYS$OUTPUT ""
 | 
			
		||||
$!
 | 
			
		||||
$!    Time To EXIT.
 | 
			
		||||
@@ -921,7 +926,7 @@ $   ELSE
 | 
			
		||||
$!
 | 
			
		||||
$!    Check To See If We Have VAXC Or DECC.
 | 
			
		||||
$!
 | 
			
		||||
$     IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
 | 
			
		||||
$     IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
 | 
			
		||||
$     THEN 
 | 
			
		||||
$!
 | 
			
		||||
$!      Looks Like DECC, Set To Use DECC.
 | 
			
		||||
@@ -1027,12 +1032,12 @@ $     IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" -
 | 
			
		||||
	 THEN CC = "CC/DECC"
 | 
			
		||||
$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
 | 
			
		||||
           "/NOLIST/PREFIX=ALL" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
 | 
			
		||||
	   CCEXTRAFLAGS
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
$!
 | 
			
		||||
$     OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
 | 
			
		||||
$     OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT"
 | 
			
		||||
$!
 | 
			
		||||
$!  End DECC Check.
 | 
			
		||||
$!
 | 
			
		||||
@@ -1054,14 +1059,14 @@ $!
 | 
			
		||||
$!    Compile Using VAXC.
 | 
			
		||||
$!
 | 
			
		||||
$     CC = "CC"
 | 
			
		||||
$     IF ARCH.EQS."AXP"
 | 
			
		||||
$     IF ARCH.NES."VAX"
 | 
			
		||||
$     THEN
 | 
			
		||||
$	WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
 | 
			
		||||
$	WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
 | 
			
		||||
$	EXIT
 | 
			
		||||
$     ENDIF
 | 
			
		||||
$     IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
 | 
			
		||||
$     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
 | 
			
		||||
	   CCEXTRAFLAGS
 | 
			
		||||
$     CCDEFS = """VAXC""," + CCDEFS
 | 
			
		||||
$!
 | 
			
		||||
@@ -1071,7 +1076,7 @@ $     DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
$!
 | 
			
		||||
$     OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
 | 
			
		||||
$     OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT"
 | 
			
		||||
$!
 | 
			
		||||
$!  End VAXC Check
 | 
			
		||||
$!
 | 
			
		||||
@@ -1093,12 +1098,12 @@ $!
 | 
			
		||||
$!    Use GNU C...
 | 
			
		||||
$!
 | 
			
		||||
$     CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
 | 
			
		||||
	   "/INCLUDE=(SYS$DISK:[],SYS$DISK:[.''ARCH'],SYS$DISK:[-],SYS$DISK:[.ENGINE.VENDOR_DEFNS],SYS$DISK:[.EVP],SYS$DISK:[.ASN1])" + -
 | 
			
		||||
	   CCEXTRAFLAGS
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
$!
 | 
			
		||||
$     OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
 | 
			
		||||
$     OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT"
 | 
			
		||||
$!
 | 
			
		||||
$!  End The GNU C Check.
 | 
			
		||||
$!
 | 
			
		||||
@@ -1168,7 +1173,7 @@ $!
 | 
			
		||||
$! Build a MACRO command for the architecture at hand
 | 
			
		||||
$!
 | 
			
		||||
$ IF ARCH .EQS. "VAX" THEN MACRO = "MACRO/''DEBUGGER'"
 | 
			
		||||
$ IF ARCH .EQS. "AXP" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'"
 | 
			
		||||
$ IF ARCH .NES. "VAX" THEN MACRO = "MACRO/MIGRATION/''DEBUGGER'/''MACRO_OPTIMIZE'"
 | 
			
		||||
$!
 | 
			
		||||
$!  Show user the result
 | 
			
		||||
$!
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ $!  Changes by Richard Levitte <richard@levitte.org>
 | 
			
		||||
$!
 | 
			
		||||
$!  This command files compiles and creates the 
 | 
			
		||||
$!  "[.xxx.EXE.CRYPTO.DES]LIBDES.OLB" library.  The "xxx" denotes the machine 
 | 
			
		||||
$!  architecture of AXP or VAX.
 | 
			
		||||
$!  architecture of ALPHA, IA64 or VAX.
 | 
			
		||||
$!
 | 
			
		||||
$!  It was re-written to try to determine which "C" compiler to try to use
 | 
			
		||||
$!  or the user can specify a compiler in P3.
 | 
			
		||||
@@ -45,25 +45,34 @@ $!
 | 
			
		||||
$!
 | 
			
		||||
$! Check Which Architecture We Are Using.
 | 
			
		||||
$!
 | 
			
		||||
$ IF (F$GETSYI("CPU").GE.128)
 | 
			
		||||
$ IF (F$GETSYI("CPU").LT.128)
 | 
			
		||||
$ THEN
 | 
			
		||||
$!
 | 
			
		||||
$!  The Architecture Is AXP.
 | 
			
		||||
$!  The Architecture Is VAX
 | 
			
		||||
$!
 | 
			
		||||
$   ARCH := AXP
 | 
			
		||||
$   ARCH := VAX
 | 
			
		||||
$!
 | 
			
		||||
$! Else...
 | 
			
		||||
$!
 | 
			
		||||
$ ELSE
 | 
			
		||||
$!
 | 
			
		||||
$!  The Architecture Is VAX.
 | 
			
		||||
$!  The Architecture Is Alpha, IA64 or whatever comes in the future.
 | 
			
		||||
$!
 | 
			
		||||
$   ARCH := VAX
 | 
			
		||||
$   ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
 | 
			
		||||
$   IF (ARCH .EQS. "") THEN ARCH = "UNK"
 | 
			
		||||
$!
 | 
			
		||||
$! End The Architecture Check.
 | 
			
		||||
$!
 | 
			
		||||
$ ENDIF
 | 
			
		||||
$!
 | 
			
		||||
$! Define The OBJ Directory Name.
 | 
			
		||||
$!
 | 
			
		||||
$ OBJ_DIR := SYS$DISK:[--.'ARCH'.OBJ.CRYPTO.DES]
 | 
			
		||||
$!
 | 
			
		||||
$! Define The EXE Directory Name.
 | 
			
		||||
$!
 | 
			
		||||
$ EXE_DIR :== SYS$DISK:[--.'ARCH'.EXE.CRYPTO.DES]
 | 
			
		||||
$!
 | 
			
		||||
$! Check To Make Sure We Have Valid Command Line Parameters.
 | 
			
		||||
$!
 | 
			
		||||
$ GOSUB CHECK_OPTIONS
 | 
			
		||||
@@ -72,10 +81,6 @@ $! Tell The User What Kind of Machine We Run On.
 | 
			
		||||
$!
 | 
			
		||||
$ WRITE SYS$OUTPUT "Compiling On A ",ARCH," Machine."
 | 
			
		||||
$!
 | 
			
		||||
$! Define The OBJ Directory Name.
 | 
			
		||||
$!
 | 
			
		||||
$ OBJ_DIR := SYS$DISK:[--.'ARCH'.OBJ.CRYPTO.DES]
 | 
			
		||||
$!
 | 
			
		||||
$! Check To See If The Architecture Specific OBJ Directory Exists.
 | 
			
		||||
$!
 | 
			
		||||
$ IF (F$PARSE(OBJ_DIR).EQS."")
 | 
			
		||||
@@ -89,10 +94,6 @@ $! End The Architecture Specific OBJ Directory Check.
 | 
			
		||||
$!
 | 
			
		||||
$ ENDIF
 | 
			
		||||
$!
 | 
			
		||||
$! Define The EXE Directory Name.
 | 
			
		||||
$!
 | 
			
		||||
$ EXE_DIR :== SYS$DISK:[--.'ARCH'.EXE.CRYPTO.DES]
 | 
			
		||||
$!
 | 
			
		||||
$! Check To See If The Architecture Specific Directory Exists.
 | 
			
		||||
$!
 | 
			
		||||
$ IF (F$PARSE(EXE_DIR).EQS."")
 | 
			
		||||
@@ -564,7 +565,7 @@ $!
 | 
			
		||||
$   IF (F$SEARCH(OPT_FILE).EQS."")
 | 
			
		||||
$   THEN
 | 
			
		||||
$!
 | 
			
		||||
$!    Figure Out If We Need An AXP Or A VAX Linker Option File.
 | 
			
		||||
$!    Figure Out If We Need An non-VAX Or A VAX Linker Option File.
 | 
			
		||||
$!
 | 
			
		||||
$     IF (F$GETSYI("CPU").LT.128)
 | 
			
		||||
$     THEN
 | 
			
		||||
@@ -584,19 +585,19 @@ $!    Else...
 | 
			
		||||
$!
 | 
			
		||||
$     ELSE
 | 
			
		||||
$!
 | 
			
		||||
$!      Create The AXP Linker Option File.
 | 
			
		||||
$!      Create The non-VAX Linker Option File.
 | 
			
		||||
$!
 | 
			
		||||
$       CREATE 'OPT_FILE'
 | 
			
		||||
$DECK
 | 
			
		||||
!
 | 
			
		||||
! Default System Options File For AXP To Link Agianst 
 | 
			
		||||
! Default System Options File For non-VAX To Link Agianst 
 | 
			
		||||
! The Sharable C Runtime Library.
 | 
			
		||||
!
 | 
			
		||||
SYS$SHARE:CMA$OPEN_LIB_SHR/SHARE
 | 
			
		||||
SYS$SHARE:CMA$OPEN_RTL/SHARE
 | 
			
		||||
$EOD
 | 
			
		||||
$!
 | 
			
		||||
$!    End The VAX/AXP DEC C Option File Check.
 | 
			
		||||
$!    End The DEC C Option File Check.
 | 
			
		||||
$!
 | 
			
		||||
$     ENDIF
 | 
			
		||||
$!
 | 
			
		||||
@@ -687,8 +688,9 @@ $     WRITE SYS$OUTPUT "    DES_OPTS :  To Compile Just The [.xxx.EXE.CRYTPO.DES
 | 
			
		||||
$     WRITE SYS$OUTPUT ""
 | 
			
		||||
$     WRITE SYS$OUTPUT " Where 'xxx' Stands For: "
 | 
			
		||||
$     WRITE SYS$OUTPUT ""
 | 
			
		||||
$     WRITE SYS$OUTPUT "        AXP  :  Alpha Architecture."
 | 
			
		||||
$     WRITE SYS$OUTPUT "        VAX  :  VAX Architecture."
 | 
			
		||||
$     WRITE SYS$OUTPUT "    ALPHA    :  Alpha Architecture."
 | 
			
		||||
$     WRITE SYS$OUTPUT "    IA64     :  IA64 Architecture."
 | 
			
		||||
$     WRITE SYS$OUTPUT "    VAX      :  VAX Architecture."
 | 
			
		||||
$     WRITE SYS$OUTPUT ""
 | 
			
		||||
$!
 | 
			
		||||
$!    Time To EXIT.
 | 
			
		||||
@@ -817,7 +819,7 @@ $   ELSE
 | 
			
		||||
$!
 | 
			
		||||
$!    Check To See If We Have VAXC Or DECC.
 | 
			
		||||
$!
 | 
			
		||||
$     IF (ARCH.EQS."AXP").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
 | 
			
		||||
$     IF (ARCH.NES."VAX").OR.(F$TRNLNM("DECC$CC_DEFAULT").NES."")
 | 
			
		||||
$     THEN 
 | 
			
		||||
$!
 | 
			
		||||
$!      Looks Like DECC, Set To Use DECC.
 | 
			
		||||
@@ -882,7 +884,7 @@ $     CC = CC + "/''CC_OPTIMIZE'/''DEBUGGER'/STANDARD=ANSI89" + -
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
$!
 | 
			
		||||
$     OPT_FILE = "SYS$DISK:[]VAX_DECC_OPTIONS.OPT"
 | 
			
		||||
$     OPT_FILE = "''EXE_DIR'VAX_DECC_OPTIONS.OPT"
 | 
			
		||||
$!
 | 
			
		||||
$!  End DECC Check.
 | 
			
		||||
$!
 | 
			
		||||
@@ -904,9 +906,9 @@ $!
 | 
			
		||||
$!    Compile Using VAXC.
 | 
			
		||||
$!
 | 
			
		||||
$     CC = "CC"
 | 
			
		||||
$     IF ARCH.EQS."AXP"
 | 
			
		||||
$     IF ARCH.NES."VAX"
 | 
			
		||||
$     THEN
 | 
			
		||||
$	WRITE SYS$OUTPUT "There is no VAX C on Alpha!"
 | 
			
		||||
$	WRITE SYS$OUTPUT "There is no VAX C on ''ARCH'!"
 | 
			
		||||
$	EXIT
 | 
			
		||||
$     ENDIF
 | 
			
		||||
$     IF F$TRNLNM("DECC$CC_DEFAULT").EQS."/DECC" THEN CC = "CC/VAXC"
 | 
			
		||||
@@ -919,7 +921,7 @@ $     DEFINE/NOLOG SYS SYS$COMMON:[SYSLIB]
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
$!
 | 
			
		||||
$     OPT_FILE = "SYS$DISK:[]VAX_VAXC_OPTIONS.OPT"
 | 
			
		||||
$     OPT_FILE = "''EXE_DIR'VAX_VAXC_OPTIONS.OPT"
 | 
			
		||||
$!
 | 
			
		||||
$!  End VAXC Check
 | 
			
		||||
$!
 | 
			
		||||
@@ -944,7 +946,7 @@ $     CC = "GCC/NOCASE_HACK/''GCC_OPTIMIZE'/''DEBUGGER'/NOLIST" + CCEXTRAFLAGS
 | 
			
		||||
$!
 | 
			
		||||
$!    Define The Linker Options File Name.
 | 
			
		||||
$!
 | 
			
		||||
$     OPT_FILE = "SYS$DISK:[]VAX_GNUC_OPTIONS.OPT"
 | 
			
		||||
$     OPT_FILE = "''EXE_DIR'VAX_GNUC_OPTIONS.OPT"
 | 
			
		||||
$!
 | 
			
		||||
$!  End The GNU C Check.
 | 
			
		||||
$!
 | 
			
		||||
 
 | 
			
		||||
@@ -150,7 +150,7 @@ int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
 | 
			
		||||
	/* first - get the length */
 | 
			
		||||
	while (net_num < HDRSIZE) 
 | 
			
		||||
		{
 | 
			
		||||
#ifndef _WIN32
 | 
			
		||||
#ifndef OPENSSL_SYS_WIN32
 | 
			
		||||
		i=read(fd,(void *)&(net[net_num]),HDRSIZE-net_num);
 | 
			
		||||
#else
 | 
			
		||||
		i=_read(fd,(void *)&(net[net_num]),HDRSIZE-net_num);
 | 
			
		||||
@@ -176,7 +176,11 @@ int DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,
 | 
			
		||||
	net_num=0;
 | 
			
		||||
	while (net_num < rnum)
 | 
			
		||||
		{
 | 
			
		||||
#ifndef OPENSSL_SYS_WIN32
 | 
			
		||||
		i=read(fd,(void *)&(net[net_num]),rnum-net_num);
 | 
			
		||||
#else
 | 
			
		||||
		i=_read(fd,(void *)&(net[net_num]),rnum-net_num);
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef EINTR
 | 
			
		||||
		if ((i == -1) && (errno == EINTR)) continue;
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -164,11 +164,11 @@ dh_pmeth.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
dh_pmeth.o: ../../include/openssl/lhash.h ../../include/openssl/obj_mac.h
 | 
			
		||||
dh_pmeth.o: ../../include/openssl/objects.h ../../include/openssl/opensslconf.h
 | 
			
		||||
dh_pmeth.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
dh_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/rsa.h
 | 
			
		||||
dh_pmeth.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
dh_pmeth.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
dh_pmeth.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
dh_pmeth.o: ../cryptlib.h ../evp/evp_locl.h dh_pmeth.c
 | 
			
		||||
dh_pmeth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h
 | 
			
		||||
dh_pmeth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
dh_pmeth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
dh_pmeth.o: ../../include/openssl/x509_vfy.h ../cryptlib.h ../evp/evp_locl.h
 | 
			
		||||
dh_pmeth.o: dh_pmeth.c
 | 
			
		||||
dh_prn.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
dh_prn.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
dh_prn.o: ../../include/openssl/dh.h ../../include/openssl/e_os2.h
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,6 @@
 | 
			
		||||
#include "cryptlib.h"
 | 
			
		||||
#include <openssl/asn1t.h>
 | 
			
		||||
#include <openssl/x509.h>
 | 
			
		||||
#include <openssl/rsa.h>
 | 
			
		||||
#include <openssl/evp.h>
 | 
			
		||||
#include <openssl/dh.h>
 | 
			
		||||
#include <openssl/bn.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -69,12 +69,15 @@ static int sig_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
 | 
			
		||||
	if(operation == ASN1_OP_NEW_PRE) {
 | 
			
		||||
		DSA_SIG *sig;
 | 
			
		||||
		sig = OPENSSL_malloc(sizeof(DSA_SIG));
 | 
			
		||||
		if (!sig)
 | 
			
		||||
			{
 | 
			
		||||
			DSAerr(DSA_F_SIG_CB, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			return 0;
 | 
			
		||||
			}
 | 
			
		||||
		sig->r = NULL;
 | 
			
		||||
		sig->s = NULL;
 | 
			
		||||
		*pval = (ASN1_VALUE *)sig;
 | 
			
		||||
		if(sig) return 2;
 | 
			
		||||
		DSAerr(DSA_F_SIG_CB, ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return 0;
 | 
			
		||||
		return 2;
 | 
			
		||||
	}
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -355,6 +355,7 @@ static struct file_st *win32_splitter(DSO *dso, const char *filename,
 | 
			
		||||
				DSOerr(DSO_F_WIN32_SPLITTER,
 | 
			
		||||
					DSO_R_INCORRECT_FILE_SYNTAX);
 | 
			
		||||
				/*goto err;*/
 | 
			
		||||
				OPENSSL_free(result);
 | 
			
		||||
				return(NULL);
 | 
			
		||||
				}
 | 
			
		||||
			result->device = start;
 | 
			
		||||
@@ -621,6 +622,8 @@ static char *win32_merger(DSO *dso, const char *filespec1, const char *filespec2
 | 
			
		||||
 | 
			
		||||
		merged = win32_joiner(dso, filespec1_split);
 | 
			
		||||
		}
 | 
			
		||||
	OPENSSL_free(filespec1_split);
 | 
			
		||||
	OPENSSL_free(filespec2_split);
 | 
			
		||||
	return(merged);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -419,7 +419,7 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
 | 
			
		||||
			if (numblocks > pre_comp->numblocks)
 | 
			
		||||
				numblocks = pre_comp->numblocks;
 | 
			
		||||
 | 
			
		||||
			pre_points_per_block = 1u << (pre_comp->w - 1);
 | 
			
		||||
			pre_points_per_block = (size_t)1 << (pre_comp->w - 1);
 | 
			
		||||
 | 
			
		||||
			/* check that pre_comp looks sane */
 | 
			
		||||
			if (pre_comp->num != (pre_comp->numblocks * pre_points_per_block))
 | 
			
		||||
@@ -461,7 +461,7 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
 | 
			
		||||
 | 
			
		||||
		bits = i < num ? BN_num_bits(scalars[i]) : BN_num_bits(scalar);
 | 
			
		||||
		wsize[i] = EC_window_bits_for_scalar_size(bits);
 | 
			
		||||
		num_val += 1u << (wsize[i] - 1);
 | 
			
		||||
		num_val += (size_t)1 << (wsize[i] - 1);
 | 
			
		||||
		wNAF[i + 1] = NULL; /* make sure we always have a pivot */
 | 
			
		||||
		wNAF[i] = compute_wNAF((i < num ? scalars[i] : scalar), wsize[i], &wNAF_len[i]);
 | 
			
		||||
		if (wNAF[i] == NULL)
 | 
			
		||||
@@ -600,7 +600,7 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
 | 
			
		||||
	for (i = 0; i < num + num_scalar; i++)
 | 
			
		||||
		{
 | 
			
		||||
		val_sub[i] = v;
 | 
			
		||||
		for (j = 0; j < (1u << (wsize[i] - 1)); j++)
 | 
			
		||||
		for (j = 0; j < ((size_t)1 << (wsize[i] - 1)); j++)
 | 
			
		||||
			{
 | 
			
		||||
			*v = EC_POINT_new(group);
 | 
			
		||||
			if (*v == NULL) goto err;
 | 
			
		||||
@@ -636,7 +636,7 @@ int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
 | 
			
		||||
		if (wsize[i] > 1)
 | 
			
		||||
			{
 | 
			
		||||
			if (!EC_POINT_dbl(group, tmp, val_sub[i][0], ctx)) goto err;
 | 
			
		||||
			for (j = 1; j < (1u << (wsize[i] - 1)); j++)
 | 
			
		||||
			for (j = 1; j < ((size_t)1 << (wsize[i] - 1)); j++)
 | 
			
		||||
				{
 | 
			
		||||
				if (!EC_POINT_add(group, val_sub[i][j], val_sub[i][j - 1], tmp, ctx)) goto err;
 | 
			
		||||
				}
 | 
			
		||||
@@ -820,7 +820,7 @@ int ec_wNAF_precompute_mult(EC_GROUP *group, BN_CTX *ctx)
 | 
			
		||||
 | 
			
		||||
	numblocks = (bits + blocksize - 1) / blocksize; /* max. number of blocks to use for wNAF splitting */
 | 
			
		||||
	
 | 
			
		||||
	pre_points_per_block = 1u << (w - 1);
 | 
			
		||||
	pre_points_per_block = (size_t)1 << (w - 1);
 | 
			
		||||
	num = pre_points_per_block * numblocks; /* number of points to compute and store */
 | 
			
		||||
 | 
			
		||||
	points = OPENSSL_malloc(sizeof (EC_POINT*)*(num + 1));
 | 
			
		||||
 
 | 
			
		||||
@@ -68,7 +68,7 @@ void ENGINE_load_builtin_engines(void)
 | 
			
		||||
	 * *no* builtin implementations). */
 | 
			
		||||
	ENGINE_load_openssl();
 | 
			
		||||
#endif
 | 
			
		||||
#if defined(__OpenBSD__) || defined(__FreeBSD__)
 | 
			
		||||
#if !defined(OPENSSL_NO_HW) && (defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV))
 | 
			
		||||
	ENGINE_load_cryptodev();
 | 
			
		||||
#endif
 | 
			
		||||
	ENGINE_load_dynamic();
 | 
			
		||||
@@ -114,7 +114,7 @@ void ENGINE_load_builtin_engines(void)
 | 
			
		||||
#endif
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
#if defined(__OpenBSD__) || defined(__FreeBSD__)
 | 
			
		||||
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
 | 
			
		||||
void ENGINE_setup_bsd_cryptodev(void) {
 | 
			
		||||
	static int bsd_cryptodev_default_loaded = 0;
 | 
			
		||||
	if (!bsd_cryptodev_default_loaded) {
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@
 | 
			
		||||
#include <openssl/bn.h>
 | 
			
		||||
 | 
			
		||||
#if (defined(__unix__) || defined(unix)) && !defined(USG) && \
 | 
			
		||||
	(defined(OpenBSD) || defined(__FreeBSD_version))
 | 
			
		||||
	(defined(OpenBSD) || defined(__FreeBSD__))
 | 
			
		||||
#include <sys/param.h>
 | 
			
		||||
# if (OpenBSD >= 200112) || ((__FreeBSD_version >= 470101 && __FreeBSD_version < 500000) || __FreeBSD_version >= 500041)
 | 
			
		||||
#  define HAVE_CRYPTODEV
 | 
			
		||||
@@ -68,6 +68,16 @@ ENGINE_load_cryptodev(void)
 | 
			
		||||
struct dev_crypto_state {
 | 
			
		||||
	struct session_op d_sess;
 | 
			
		||||
	int d_fd;
 | 
			
		||||
 | 
			
		||||
#ifdef USE_CRYPTODEV_DIGESTS
 | 
			
		||||
	char dummy_mac_key[HASH_MAX_LEN];
 | 
			
		||||
 | 
			
		||||
	unsigned char digest_res[HASH_MAX_LEN];
 | 
			
		||||
	char *mac_data;
 | 
			
		||||
	int mac_len;
 | 
			
		||||
 | 
			
		||||
	int copy;
 | 
			
		||||
#endif
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static u_int32_t cryptodev_asymfeat = 0;
 | 
			
		||||
@@ -75,15 +85,12 @@ static u_int32_t cryptodev_asymfeat = 0;
 | 
			
		||||
static int get_asym_dev_crypto(void);
 | 
			
		||||
static int open_dev_crypto(void);
 | 
			
		||||
static int get_dev_crypto(void);
 | 
			
		||||
static int cryptodev_max_iv(int cipher);
 | 
			
		||||
static int cryptodev_key_length_valid(int cipher, int len);
 | 
			
		||||
static int cipher_nid_to_cryptodev(int nid);
 | 
			
		||||
static int get_cryptodev_ciphers(const int **cnids);
 | 
			
		||||
static int get_cryptodev_digests(const int **cnids);
 | 
			
		||||
static int cryptodev_usable_ciphers(const int **nids);
 | 
			
		||||
static int cryptodev_usable_digests(const int **nids);
 | 
			
		||||
static int cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 | 
			
		||||
    const unsigned char *in, unsigned int inl);
 | 
			
		||||
    const unsigned char *in, size_t inl);
 | 
			
		||||
static int cryptodev_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 | 
			
		||||
    const unsigned char *iv, int enc);
 | 
			
		||||
static int cryptodev_cleanup(EVP_CIPHER_CTX *ctx);
 | 
			
		||||
@@ -100,7 +107,7 @@ static int cryptodev_asym(struct crypt_kop *kop, int rlen, BIGNUM *r,
 | 
			
		||||
static int cryptodev_bn_mod_exp(BIGNUM *r, const BIGNUM *a,
 | 
			
		||||
    const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
 | 
			
		||||
static int cryptodev_rsa_nocrt_mod_exp(BIGNUM *r0, const BIGNUM *I,
 | 
			
		||||
    RSA *rsa);
 | 
			
		||||
    RSA *rsa, BN_CTX *ctx);
 | 
			
		||||
static int cryptodev_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
 | 
			
		||||
static int cryptodev_dsa_bn_mod_exp(DSA *dsa, BIGNUM *r, BIGNUM *a,
 | 
			
		||||
    const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);
 | 
			
		||||
@@ -130,9 +137,12 @@ static struct {
 | 
			
		||||
	int	ivmax;
 | 
			
		||||
	int	keylen;
 | 
			
		||||
} ciphers[] = {
 | 
			
		||||
	{ CRYPTO_ARC4,			NID_rc4,		0,	16, },
 | 
			
		||||
	{ CRYPTO_DES_CBC,		NID_des_cbc,		8,	 8, },
 | 
			
		||||
	{ CRYPTO_3DES_CBC,		NID_des_ede3_cbc,	8,	24, },
 | 
			
		||||
	{ CRYPTO_AES_CBC,		NID_aes_128_cbc,	16,	16, },
 | 
			
		||||
	{ CRYPTO_AES_CBC,		NID_aes_192_cbc,	16,	24, },
 | 
			
		||||
	{ CRYPTO_AES_CBC,		NID_aes_256_cbc,	16,	32, },
 | 
			
		||||
	{ CRYPTO_BLF_CBC,		NID_bf_cbc,		8,	16, },
 | 
			
		||||
	{ CRYPTO_CAST_CBC,		NID_cast5_cbc,		8,	16, },
 | 
			
		||||
	{ CRYPTO_SKIPJACK_CBC,		NID_undef,		0,	 0, },
 | 
			
		||||
@@ -142,14 +152,16 @@ static struct {
 | 
			
		||||
static struct {
 | 
			
		||||
	int	id;
 | 
			
		||||
	int	nid;
 | 
			
		||||
	int 	keylen;
 | 
			
		||||
} digests[] = {
 | 
			
		||||
	{ CRYPTO_SHA1_HMAC,		NID_hmacWithSHA1,	},
 | 
			
		||||
	{ CRYPTO_RIPEMD160_HMAC,	NID_ripemd160,		},
 | 
			
		||||
	{ CRYPTO_MD5_KPDK,		NID_undef,		},
 | 
			
		||||
	{ CRYPTO_SHA1_KPDK,		NID_undef,		},
 | 
			
		||||
	{ CRYPTO_MD5,			NID_md5,		},
 | 
			
		||||
	{ CRYPTO_SHA1,			NID_undef,		},
 | 
			
		||||
	{ 0,				NID_undef,		},
 | 
			
		||||
	{ CRYPTO_MD5_HMAC,		NID_hmacWithMD5,	16},
 | 
			
		||||
	{ CRYPTO_SHA1_HMAC,		NID_hmacWithSHA1,	20},
 | 
			
		||||
	{ CRYPTO_RIPEMD160_HMAC,	NID_ripemd160,		16/*?*/},
 | 
			
		||||
	{ CRYPTO_MD5_KPDK,		NID_undef,		0},
 | 
			
		||||
	{ CRYPTO_SHA1_KPDK,		NID_undef,		0},
 | 
			
		||||
	{ CRYPTO_MD5,			NID_md5,		16},
 | 
			
		||||
	{ CRYPTO_SHA1,			NID_sha1,		20},
 | 
			
		||||
	{ 0,				NID_undef,		0},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
@@ -202,50 +214,6 @@ get_asym_dev_crypto(void)
 | 
			
		||||
	return fd;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * XXXX this needs to be set for each alg - and determined from
 | 
			
		||||
 * a running card.
 | 
			
		||||
 */
 | 
			
		||||
static int
 | 
			
		||||
cryptodev_max_iv(int cipher)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; ciphers[i].id; i++)
 | 
			
		||||
		if (ciphers[i].id == cipher)
 | 
			
		||||
			return (ciphers[i].ivmax);
 | 
			
		||||
	return (0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * XXXX this needs to be set for each alg - and determined from
 | 
			
		||||
 * a running card. For now, fake it out - but most of these
 | 
			
		||||
 * for real devices should return 1 for the supported key
 | 
			
		||||
 * sizes the device can handle.
 | 
			
		||||
 */
 | 
			
		||||
static int
 | 
			
		||||
cryptodev_key_length_valid(int cipher, int len)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; ciphers[i].id; i++)
 | 
			
		||||
		if (ciphers[i].id == cipher)
 | 
			
		||||
			return (ciphers[i].keylen == len);
 | 
			
		||||
	return (0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* convert libcrypto nids to cryptodev */
 | 
			
		||||
static int
 | 
			
		||||
cipher_nid_to_cryptodev(int nid)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; ciphers[i].id; i++)
 | 
			
		||||
		if (ciphers[i].nid == nid)
 | 
			
		||||
			return (ciphers[i].id);
 | 
			
		||||
	return (0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Find out what ciphers /dev/crypto will let us have a session for.
 | 
			
		||||
 * XXX note, that some of these openssl doesn't deal with yet!
 | 
			
		||||
@@ -264,7 +232,7 @@ get_cryptodev_ciphers(const int **cnids)
 | 
			
		||||
		return (0);
 | 
			
		||||
	}
 | 
			
		||||
	memset(&sess, 0, sizeof(sess));
 | 
			
		||||
	sess.key = (caddr_t)"123456781234567812345678";
 | 
			
		||||
	sess.key = (caddr_t)"123456789abcdefghijklmno";
 | 
			
		||||
 | 
			
		||||
	for (i = 0; ciphers[i].id && count < CRYPTO_ALGORITHM_MAX; i++) {
 | 
			
		||||
		if (ciphers[i].nid == NID_undef)
 | 
			
		||||
@@ -303,10 +271,12 @@ get_cryptodev_digests(const int **cnids)
 | 
			
		||||
		return (0);
 | 
			
		||||
	}
 | 
			
		||||
	memset(&sess, 0, sizeof(sess));
 | 
			
		||||
	sess.mackey = (caddr_t)"123456789abcdefghijklmno";
 | 
			
		||||
	for (i = 0; digests[i].id && count < CRYPTO_ALGORITHM_MAX; i++) {
 | 
			
		||||
		if (digests[i].nid == NID_undef)
 | 
			
		||||
			continue;
 | 
			
		||||
		sess.mac = digests[i].id;
 | 
			
		||||
		sess.mackeylen = digests[i].keylen;
 | 
			
		||||
		sess.cipher = 0;
 | 
			
		||||
		if (ioctl(fd, CIOCGSESSION, &sess) != -1 &&
 | 
			
		||||
		    ioctl(fd, CIOCFSESSION, &sess.ses) != -1)
 | 
			
		||||
@@ -351,6 +321,9 @@ cryptodev_usable_ciphers(const int **nids)
 | 
			
		||||
static int
 | 
			
		||||
cryptodev_usable_digests(const int **nids)
 | 
			
		||||
{
 | 
			
		||||
#ifdef USE_CRYPTODEV_DIGESTS
 | 
			
		||||
	return (get_cryptodev_digests(nids));
 | 
			
		||||
#else
 | 
			
		||||
	/*
 | 
			
		||||
	 * XXXX just disable all digests for now, because it sucks.
 | 
			
		||||
	 * we need a better way to decide this - i.e. I may not
 | 
			
		||||
@@ -365,11 +338,12 @@ cryptodev_usable_digests(const int **nids)
 | 
			
		||||
	 */
 | 
			
		||||
	*nids = NULL;
 | 
			
		||||
	return (0);
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
cryptodev_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
 | 
			
		||||
    const unsigned char *in, unsigned int inl)
 | 
			
		||||
    const unsigned char *in, size_t inl)
 | 
			
		||||
{
 | 
			
		||||
	struct crypt_op cryp;
 | 
			
		||||
	struct dev_crypto_state *state = ctx->cipher_data;
 | 
			
		||||
@@ -427,23 +401,27 @@ cryptodev_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
 | 
			
		||||
{
 | 
			
		||||
	struct dev_crypto_state *state = ctx->cipher_data;
 | 
			
		||||
	struct session_op *sess = &state->d_sess;
 | 
			
		||||
	int cipher;
 | 
			
		||||
	int cipher, i;
 | 
			
		||||
 | 
			
		||||
	if ((cipher = cipher_nid_to_cryptodev(ctx->cipher->nid)) == NID_undef)
 | 
			
		||||
		return (0);
 | 
			
		||||
	for (i = 0; ciphers[i].id; i++)
 | 
			
		||||
		if (ctx->cipher->nid == ciphers[i].nid &&
 | 
			
		||||
		    ctx->cipher->iv_len <= ciphers[i].ivmax &&
 | 
			
		||||
		    ctx->key_len == ciphers[i].keylen) {
 | 
			
		||||
			cipher = ciphers[i].id;
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (ctx->cipher->iv_len > cryptodev_max_iv(cipher))
 | 
			
		||||
		return (0);
 | 
			
		||||
 | 
			
		||||
	if (!cryptodev_key_length_valid(cipher, ctx->key_len))
 | 
			
		||||
	if (!ciphers[i].id) {
 | 
			
		||||
		state->d_fd = -1;
 | 
			
		||||
		return (0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	memset(sess, 0, sizeof(struct session_op));
 | 
			
		||||
 | 
			
		||||
	if ((state->d_fd = get_dev_crypto()) < 0)
 | 
			
		||||
		return (0);
 | 
			
		||||
 | 
			
		||||
	sess->key = (unsigned char *)key;
 | 
			
		||||
	sess->key = (caddr_t)key;
 | 
			
		||||
	sess->keylen = ctx->key_len;
 | 
			
		||||
	sess->cipher = cipher;
 | 
			
		||||
 | 
			
		||||
@@ -496,6 +474,20 @@ cryptodev_cleanup(EVP_CIPHER_CTX *ctx)
 | 
			
		||||
 * gets called when libcrypto requests a cipher NID.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* RC4 */
 | 
			
		||||
const EVP_CIPHER cryptodev_rc4 = {
 | 
			
		||||
	NID_rc4,
 | 
			
		||||
	1, 16, 0,
 | 
			
		||||
	EVP_CIPH_VARIABLE_LENGTH,
 | 
			
		||||
	cryptodev_init_key,
 | 
			
		||||
	cryptodev_cipher,
 | 
			
		||||
	cryptodev_cleanup,
 | 
			
		||||
	sizeof(struct dev_crypto_state),
 | 
			
		||||
	NULL,
 | 
			
		||||
	NULL,
 | 
			
		||||
	NULL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* DES CBC EVP */
 | 
			
		||||
const EVP_CIPHER cryptodev_des_cbc = {
 | 
			
		||||
	NID_des_cbc,
 | 
			
		||||
@@ -563,6 +555,32 @@ const EVP_CIPHER cryptodev_aes_cbc = {
 | 
			
		||||
	NULL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const EVP_CIPHER cryptodev_aes_192_cbc = {
 | 
			
		||||
	NID_aes_192_cbc,
 | 
			
		||||
	16, 24, 16,
 | 
			
		||||
	EVP_CIPH_CBC_MODE,
 | 
			
		||||
	cryptodev_init_key,
 | 
			
		||||
	cryptodev_cipher,
 | 
			
		||||
	cryptodev_cleanup,
 | 
			
		||||
	sizeof(struct dev_crypto_state),
 | 
			
		||||
	EVP_CIPHER_set_asn1_iv,
 | 
			
		||||
	EVP_CIPHER_get_asn1_iv,
 | 
			
		||||
	NULL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const EVP_CIPHER cryptodev_aes_256_cbc = {
 | 
			
		||||
	NID_aes_256_cbc,
 | 
			
		||||
	16, 32, 16,
 | 
			
		||||
	EVP_CIPH_CBC_MODE,
 | 
			
		||||
	cryptodev_init_key,
 | 
			
		||||
	cryptodev_cipher,
 | 
			
		||||
	cryptodev_cleanup,
 | 
			
		||||
	sizeof(struct dev_crypto_state),
 | 
			
		||||
	EVP_CIPHER_set_asn1_iv,
 | 
			
		||||
	EVP_CIPHER_get_asn1_iv,
 | 
			
		||||
	NULL
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Registered by the ENGINE when used to find out how to deal with
 | 
			
		||||
 * a particular NID in the ENGINE. this says what we'll do at the
 | 
			
		||||
@@ -576,6 +594,9 @@ cryptodev_engine_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
 | 
			
		||||
		return (cryptodev_usable_ciphers(nids));
 | 
			
		||||
 | 
			
		||||
	switch (nid) {
 | 
			
		||||
	case NID_rc4:
 | 
			
		||||
		*cipher = &cryptodev_rc4;
 | 
			
		||||
		break;
 | 
			
		||||
	case NID_des_ede3_cbc:
 | 
			
		||||
		*cipher = &cryptodev_3des_cbc;
 | 
			
		||||
		break;
 | 
			
		||||
@@ -591,6 +612,12 @@ cryptodev_engine_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
 | 
			
		||||
	case NID_aes_128_cbc:
 | 
			
		||||
		*cipher = &cryptodev_aes_cbc;
 | 
			
		||||
		break;
 | 
			
		||||
	case NID_aes_192_cbc:
 | 
			
		||||
		*cipher = &cryptodev_aes_192_cbc;
 | 
			
		||||
		break;
 | 
			
		||||
	case NID_aes_256_cbc:
 | 
			
		||||
		*cipher = &cryptodev_aes_256_cbc;
 | 
			
		||||
		break;
 | 
			
		||||
	default:
 | 
			
		||||
		*cipher = NULL;
 | 
			
		||||
		break;
 | 
			
		||||
@@ -598,6 +625,234 @@ cryptodev_engine_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
 | 
			
		||||
	return (*cipher != NULL);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef USE_CRYPTODEV_DIGESTS
 | 
			
		||||
 | 
			
		||||
/* convert digest type to cryptodev */
 | 
			
		||||
static int
 | 
			
		||||
digest_nid_to_cryptodev(int nid)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; digests[i].id; i++)
 | 
			
		||||
		if (digests[i].nid == nid)
 | 
			
		||||
			return (digests[i].id);
 | 
			
		||||
	return (0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
digest_key_length(int nid)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; digests[i].id; i++)
 | 
			
		||||
		if (digests[i].nid == nid)
 | 
			
		||||
			return digests[i].keylen;
 | 
			
		||||
	return (0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int cryptodev_digest_init(EVP_MD_CTX *ctx)
 | 
			
		||||
{
 | 
			
		||||
	struct dev_crypto_state *state = ctx->md_data;
 | 
			
		||||
	struct session_op *sess = &state->d_sess;
 | 
			
		||||
	int digest;
 | 
			
		||||
 | 
			
		||||
	if ((digest = digest_nid_to_cryptodev(ctx->digest->type)) == NID_undef){
 | 
			
		||||
		printf("cryptodev_digest_init: Can't get digest \n");
 | 
			
		||||
		return (0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	memset(state, 0, sizeof(struct dev_crypto_state));
 | 
			
		||||
 | 
			
		||||
	if ((state->d_fd = get_dev_crypto()) < 0) {
 | 
			
		||||
		printf("cryptodev_digest_init: Can't get Dev \n");
 | 
			
		||||
		return (0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	sess->mackey = state->dummy_mac_key;
 | 
			
		||||
	sess->mackeylen = digest_key_length(ctx->digest->type);
 | 
			
		||||
	sess->mac = digest;
 | 
			
		||||
 | 
			
		||||
	if (ioctl(state->d_fd, CIOCGSESSION, sess) < 0) {
 | 
			
		||||
		close(state->d_fd);
 | 
			
		||||
		state->d_fd = -1;
 | 
			
		||||
		printf("cryptodev_digest_init: Open session failed\n");
 | 
			
		||||
		return (0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return (1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int cryptodev_digest_update(EVP_MD_CTX *ctx, const void *data,
 | 
			
		||||
		size_t count)
 | 
			
		||||
{
 | 
			
		||||
	struct crypt_op cryp;
 | 
			
		||||
	struct dev_crypto_state *state = ctx->md_data;
 | 
			
		||||
	struct session_op *sess = &state->d_sess;
 | 
			
		||||
 | 
			
		||||
	if (!data || state->d_fd < 0) {
 | 
			
		||||
		printf("cryptodev_digest_update: illegal inputs \n");
 | 
			
		||||
		return (0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!count) {
 | 
			
		||||
		return (0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!(ctx->flags & EVP_MD_CTX_FLAG_ONESHOT)) {
 | 
			
		||||
		/* if application doesn't support one buffer */
 | 
			
		||||
		state->mac_data = OPENSSL_realloc(state->mac_data, state->mac_len + count);
 | 
			
		||||
 | 
			
		||||
		if (!state->mac_data) {
 | 
			
		||||
			printf("cryptodev_digest_update: realloc failed\n");
 | 
			
		||||
			return (0);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		memcpy(state->mac_data + state->mac_len, data, count);
 | 
			
		||||
   		state->mac_len += count;
 | 
			
		||||
	
 | 
			
		||||
		return (1);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	memset(&cryp, 0, sizeof(cryp));
 | 
			
		||||
 | 
			
		||||
	cryp.ses = sess->ses;
 | 
			
		||||
	cryp.flags = 0;
 | 
			
		||||
	cryp.len = count;
 | 
			
		||||
	cryp.src = (caddr_t) data;
 | 
			
		||||
	cryp.dst = NULL;
 | 
			
		||||
	cryp.mac = (caddr_t) state->digest_res;
 | 
			
		||||
	if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) {
 | 
			
		||||
		printf("cryptodev_digest_update: digest failed\n");
 | 
			
		||||
		return (0);
 | 
			
		||||
	}
 | 
			
		||||
	return (1);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int cryptodev_digest_final(EVP_MD_CTX *ctx, unsigned char *md)
 | 
			
		||||
{
 | 
			
		||||
	struct crypt_op cryp;
 | 
			
		||||
	struct dev_crypto_state *state = ctx->md_data;
 | 
			
		||||
	struct session_op *sess = &state->d_sess;
 | 
			
		||||
 | 
			
		||||
	int ret = 1;
 | 
			
		||||
 | 
			
		||||
	if (!md || state->d_fd < 0) {
 | 
			
		||||
		printf("cryptodev_digest_final: illegal input\n");
 | 
			
		||||
		return(0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (! (ctx->flags & EVP_MD_CTX_FLAG_ONESHOT) ) {
 | 
			
		||||
		/* if application doesn't support one buffer */
 | 
			
		||||
		memset(&cryp, 0, sizeof(cryp));
 | 
			
		||||
 | 
			
		||||
		cryp.ses = sess->ses;
 | 
			
		||||
		cryp.flags = 0;
 | 
			
		||||
		cryp.len = state->mac_len;
 | 
			
		||||
		cryp.src = state->mac_data;
 | 
			
		||||
		cryp.dst = NULL;
 | 
			
		||||
		cryp.mac = (caddr_t)md;
 | 
			
		||||
 | 
			
		||||
		if (ioctl(state->d_fd, CIOCCRYPT, &cryp) < 0) {
 | 
			
		||||
			printf("cryptodev_digest_final: digest failed\n");
 | 
			
		||||
			return (0);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return 1;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	memcpy(md, state->digest_res, ctx->digest->md_size);
 | 
			
		||||
 | 
			
		||||
	return (ret);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int cryptodev_digest_cleanup(EVP_MD_CTX *ctx)
 | 
			
		||||
{
 | 
			
		||||
	int ret = 1;
 | 
			
		||||
	struct dev_crypto_state *state = ctx->md_data;
 | 
			
		||||
	struct session_op *sess = &state->d_sess;
 | 
			
		||||
 | 
			
		||||
	if (state->d_fd < 0) {
 | 
			
		||||
		printf("cryptodev_digest_cleanup: illegal input\n");
 | 
			
		||||
		return (0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (state->mac_data) {
 | 
			
		||||
		OPENSSL_free(state->mac_data);
 | 
			
		||||
		state->mac_data = NULL;
 | 
			
		||||
		state->mac_len = 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (state->copy)
 | 
			
		||||
		return 1;
 | 
			
		||||
 | 
			
		||||
	if (ioctl(state->d_fd, CIOCFSESSION, &sess->ses) < 0) {
 | 
			
		||||
		printf("cryptodev_digest_cleanup: failed to close session\n");
 | 
			
		||||
		ret = 0;
 | 
			
		||||
	} else {
 | 
			
		||||
		ret = 1;
 | 
			
		||||
	}
 | 
			
		||||
	close(state->d_fd);	
 | 
			
		||||
	state->d_fd = -1;
 | 
			
		||||
 | 
			
		||||
	return (ret);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int cryptodev_digest_copy(EVP_MD_CTX *to,const EVP_MD_CTX *from)
 | 
			
		||||
{
 | 
			
		||||
	struct dev_crypto_state *fstate = from->md_data;
 | 
			
		||||
	struct dev_crypto_state *dstate = to->md_data;
 | 
			
		||||
 | 
			
		||||
	memcpy(dstate, fstate, sizeof(struct dev_crypto_state));
 | 
			
		||||
 | 
			
		||||
	if (fstate->mac_len != 0) {
 | 
			
		||||
		dstate->mac_data = OPENSSL_malloc(fstate->mac_len);
 | 
			
		||||
		memcpy(dstate->mac_data, fstate->mac_data, fstate->mac_len);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	dstate->copy = 1;
 | 
			
		||||
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
const EVP_MD cryptodev_sha1 = {
 | 
			
		||||
	NID_sha1,
 | 
			
		||||
	NID_undef, 
 | 
			
		||||
	SHA_DIGEST_LENGTH, 
 | 
			
		||||
	EVP_MD_FLAG_ONESHOT,
 | 
			
		||||
	cryptodev_digest_init,
 | 
			
		||||
	cryptodev_digest_update,
 | 
			
		||||
	cryptodev_digest_final,
 | 
			
		||||
	cryptodev_digest_copy,
 | 
			
		||||
	cryptodev_digest_cleanup,
 | 
			
		||||
	EVP_PKEY_NULL_method,
 | 
			
		||||
	SHA_CBLOCK,
 | 
			
		||||
	sizeof(struct dev_crypto_state),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const EVP_MD cryptodev_md5 = {
 | 
			
		||||
	NID_md5,
 | 
			
		||||
	NID_undef, 
 | 
			
		||||
	16 /* MD5_DIGEST_LENGTH */, 
 | 
			
		||||
	EVP_MD_FLAG_ONESHOT,
 | 
			
		||||
	cryptodev_digest_init,
 | 
			
		||||
	cryptodev_digest_update,
 | 
			
		||||
	cryptodev_digest_final,
 | 
			
		||||
	cryptodev_digest_copy,
 | 
			
		||||
	cryptodev_digest_cleanup,
 | 
			
		||||
	EVP_PKEY_NULL_method,
 | 
			
		||||
	64 /* MD5_CBLOCK */,
 | 
			
		||||
	sizeof(struct dev_crypto_state),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif /* USE_CRYPTODEV_DIGESTS */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
cryptodev_engine_digests(ENGINE *e, const EVP_MD **digest,
 | 
			
		||||
    const int **nids, int nid)
 | 
			
		||||
@@ -606,10 +861,15 @@ cryptodev_engine_digests(ENGINE *e, const EVP_MD **digest,
 | 
			
		||||
		return (cryptodev_usable_digests(nids));
 | 
			
		||||
 | 
			
		||||
	switch (nid) {
 | 
			
		||||
#ifdef USE_CRYPTODEV_DIGESTS
 | 
			
		||||
	case NID_md5:
 | 
			
		||||
		*digest = NULL; /* need to make a clean md5 critter */
 | 
			
		||||
		*digest = &cryptodev_md5; 
 | 
			
		||||
		break;
 | 
			
		||||
	case NID_sha1:
 | 
			
		||||
		*digest = &cryptodev_sha1;
 | 
			
		||||
 		break;
 | 
			
		||||
	default:
 | 
			
		||||
#endif /* USE_CRYPTODEV_DIGESTS */
 | 
			
		||||
		*digest = NULL;
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
@@ -625,7 +885,7 @@ static int
 | 
			
		||||
bn2crparam(const BIGNUM *a, struct crparam *crp)
 | 
			
		||||
{
 | 
			
		||||
	int i, j, k;
 | 
			
		||||
	ssize_t words, bytes, bits;
 | 
			
		||||
	ssize_t bytes, bits;
 | 
			
		||||
	u_char *b;
 | 
			
		||||
 | 
			
		||||
	crp->crp_p = NULL;
 | 
			
		||||
@@ -637,8 +897,9 @@ bn2crparam(const BIGNUM *a, struct crparam *crp)
 | 
			
		||||
	b = malloc(bytes);
 | 
			
		||||
	if (b == NULL)
 | 
			
		||||
		return (1);
 | 
			
		||||
	memset(b, 0, bytes);
 | 
			
		||||
 | 
			
		||||
	crp->crp_p = b;
 | 
			
		||||
	crp->crp_p = (caddr_t) b;
 | 
			
		||||
	crp->crp_nbits = bits;
 | 
			
		||||
 | 
			
		||||
	for (i = 0, j = 0; i < a->top; i++) {
 | 
			
		||||
@@ -681,7 +942,7 @@ zapparams(struct crypt_kop *kop)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
 | 
			
		||||
	for (i = 0; i <= kop->crk_iparams + kop->crk_oparams; i++) {
 | 
			
		||||
	for (i = 0; i < kop->crk_iparams + kop->crk_oparams; i++) {
 | 
			
		||||
		if (kop->crk_param[i].crp_p)
 | 
			
		||||
			free(kop->crk_param[i].crp_p);
 | 
			
		||||
		kop->crk_param[i].crp_p = NULL;
 | 
			
		||||
@@ -756,11 +1017,9 @@ err:
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int
 | 
			
		||||
cryptodev_rsa_nocrt_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa)
 | 
			
		||||
cryptodev_rsa_nocrt_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx)
 | 
			
		||||
{
 | 
			
		||||
	int r;
 | 
			
		||||
	BN_CTX *ctx;
 | 
			
		||||
 | 
			
		||||
	ctx = BN_CTX_new();
 | 
			
		||||
	r = cryptodev_bn_mod_exp(r0, I, rsa->d, rsa->n, ctx, NULL);
 | 
			
		||||
	BN_CTX_free(ctx);
 | 
			
		||||
@@ -994,7 +1253,7 @@ cryptodev_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh)
 | 
			
		||||
		goto err;
 | 
			
		||||
	kop.crk_iparams = 3;
 | 
			
		||||
 | 
			
		||||
	kop.crk_param[3].crp_p = key;
 | 
			
		||||
	kop.crk_param[3].crp_p = (caddr_t) key;
 | 
			
		||||
	kop.crk_param[3].crp_nbits = keylen * 8;
 | 
			
		||||
	kop.crk_oparams = 1;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -335,9 +335,11 @@ void ENGINE_load_nuron(void);
 | 
			
		||||
void ENGINE_load_sureware(void);
 | 
			
		||||
void ENGINE_load_ubsec(void);
 | 
			
		||||
void ENGINE_load_padlock(void);
 | 
			
		||||
#ifdef OPENSSL_SYS_WIN32
 | 
			
		||||
#ifndef OPENSSL_NO_CAPIENG
 | 
			
		||||
void ENGINE_load_capi(void);
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_GMP
 | 
			
		||||
void ENGINE_load_gmp(void);
 | 
			
		||||
#endif
 | 
			
		||||
@@ -730,7 +732,7 @@ typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id,
 | 
			
		||||
 * values. */
 | 
			
		||||
void *ENGINE_get_static_state(void);
 | 
			
		||||
 | 
			
		||||
#if defined(__OpenBSD__) || defined(__FreeBSD__)
 | 
			
		||||
#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
 | 
			
		||||
void ENGINE_setup_bsd_cryptodev(void);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -437,19 +437,13 @@ m_ecdsa.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
 | 
			
		||||
m_ecdsa.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
 | 
			
		||||
m_ecdsa.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
 | 
			
		||||
m_ecdsa.o: ../cryptlib.h m_ecdsa.c
 | 
			
		||||
m_md2.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
m_md2.o: ../../e_os.h ../../include/openssl/bio.h
 | 
			
		||||
m_md2.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
m_md2.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
m_md2.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
 | 
			
		||||
m_md2.o: ../../include/openssl/err.h ../../include/openssl/evp.h
 | 
			
		||||
m_md2.o: ../../include/openssl/lhash.h ../../include/openssl/md2.h
 | 
			
		||||
m_md2.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
 | 
			
		||||
m_md2.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
 | 
			
		||||
m_md2.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
 | 
			
		||||
m_md2.o: ../../include/openssl/rsa.h ../../include/openssl/safestack.h
 | 
			
		||||
m_md2.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
 | 
			
		||||
m_md2.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h
 | 
			
		||||
m_md2.o: ../../include/openssl/x509_vfy.h ../cryptlib.h m_md2.c
 | 
			
		||||
m_md2.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
 | 
			
		||||
m_md2.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
 | 
			
		||||
m_md2.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
 | 
			
		||||
m_md2.o: ../../include/openssl/safestack.h ../../include/openssl/stack.h
 | 
			
		||||
m_md2.o: ../../include/openssl/symhacks.h ../cryptlib.h m_md2.c
 | 
			
		||||
m_md4.o: ../../e_os.h ../../include/openssl/asn1.h ../../include/openssl/bio.h
 | 
			
		||||
m_md4.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
 | 
			
		||||
m_md4.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
 | 
			
		||||
 
 | 
			
		||||
@@ -83,7 +83,7 @@ void OPENSSL_add_all_algorithms_noconf(void)
 | 
			
		||||
	OpenSSL_add_all_ciphers();
 | 
			
		||||
	OpenSSL_add_all_digests();
 | 
			
		||||
#ifndef OPENSSL_NO_ENGINE
 | 
			
		||||
# if defined(__OpenBSD__) || defined(__FreeBSD__)
 | 
			
		||||
# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
 | 
			
		||||
	ENGINE_setup_bsd_cryptodev();
 | 
			
		||||
# endif
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -64,9 +64,6 @@
 | 
			
		||||
 | 
			
		||||
void OpenSSL_add_all_digests(void)
 | 
			
		||||
	{
 | 
			
		||||
#ifndef OPENSSL_NO_MD2
 | 
			
		||||
	EVP_add_digest(EVP_md2());
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_MD4
 | 
			
		||||
	EVP_add_digest(EVP_md4());
 | 
			
		||||
#endif
 | 
			
		||||
@@ -81,7 +78,7 @@ void OpenSSL_add_all_digests(void)
 | 
			
		||||
	EVP_add_digest(EVP_dss());
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_SHA
 | 
			
		||||
#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)
 | 
			
		||||
	EVP_add_digest(EVP_sha1());
 | 
			
		||||
	EVP_add_digest_alias(SN_sha1,"ssl3-sha1");
 | 
			
		||||
	EVP_add_digest_alias(SN_sha1WithRSAEncryption,SN_sha1WithRSA);
 | 
			
		||||
 
 | 
			
		||||
@@ -279,15 +279,23 @@ struct env_md_ctx_st
 | 
			
		||||
						* cleaned */
 | 
			
		||||
#define EVP_MD_CTX_FLAG_REUSE		0x0004 /* Don't free up ctx->md_data
 | 
			
		||||
						* in EVP_MD_CTX_cleanup */
 | 
			
		||||
#define EVP_MD_CTX_FLAG_NO_INIT		0x0008 /* Don't initialized md_data */
 | 
			
		||||
/* FIPS and pad options are ignored in 1.0.0, definitions are here
 | 
			
		||||
 * so we don't accidentally reuse the values for other purposes.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
/* MD operational flags */
 | 
			
		||||
#define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW	0x0008	/* Allow use of non FIPS digest
 | 
			
		||||
						 * in FIPS mode */
 | 
			
		||||
 | 
			
		||||
#define EVP_MD_CTX_FLAG_OP_MASK		0x00f0
 | 
			
		||||
/* The following PAD options are also currently ignored in 1.0.0, digest
 | 
			
		||||
 * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*()
 | 
			
		||||
 * instead.
 | 
			
		||||
 */
 | 
			
		||||
#define EVP_MD_CTX_FLAG_PAD_MASK	0xF0	/* RSA mode to use */
 | 
			
		||||
#define EVP_MD_CTX_FLAG_PAD_PKCS1	0x00	/* PKCS#1 v1.5 mode */
 | 
			
		||||
#define EVP_MD_CTX_FLAG_PAD_X931	0x10	/* X9.31 mode */
 | 
			
		||||
#define EVP_MD_CTX_FLAG_PAD_PSS		0x20	/* PSS mode */
 | 
			
		||||
 | 
			
		||||
#define EVP_MD_CTX_FLAG_OP_DIGEST	0x0000
 | 
			
		||||
#define EVP_MD_CTX_FLAG_OP_SIGN		0x0010
 | 
			
		||||
#define EVP_MD_CTX_FLAG_OP_VERIFY	0x0020
 | 
			
		||||
#define EVP_MD_CTX_FLAG_NO_INIT		0x0100 /* Don't initialize md_data */
 | 
			
		||||
 | 
			
		||||
struct evp_cipher_st
 | 
			
		||||
	{
 | 
			
		||||
@@ -421,6 +429,7 @@ int EVP_MD_type(const EVP_MD *md);
 | 
			
		||||
int EVP_MD_pkey_type(const EVP_MD *md);	
 | 
			
		||||
int EVP_MD_size(const EVP_MD *md);
 | 
			
		||||
int EVP_MD_block_size(const EVP_MD *md);
 | 
			
		||||
unsigned long EVP_MD_flags(const EVP_MD *md);
 | 
			
		||||
 | 
			
		||||
const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);
 | 
			
		||||
#define EVP_MD_CTX_size(e)		EVP_MD_size(EVP_MD_CTX_md(e))
 | 
			
		||||
 
 | 
			
		||||
@@ -263,6 +263,11 @@ int EVP_MD_size(const EVP_MD *md)
 | 
			
		||||
	return md->md_size;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
unsigned long EVP_MD_flags(const EVP_MD *md)
 | 
			
		||||
	{
 | 
			
		||||
	return md->flags;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx)
 | 
			
		||||
	{
 | 
			
		||||
	if (!ctx)
 | 
			
		||||
 
 | 
			
		||||
@@ -145,7 +145,7 @@ static void do_all_cipher_fn(const OBJ_NAME *nm, void *arg)
 | 
			
		||||
	if (nm->alias)
 | 
			
		||||
		dc->fn(NULL, nm->name, nm->data, dc->arg);
 | 
			
		||||
	else
 | 
			
		||||
		dc->fn((const EVP_CIPHER *)nm->data, NULL, NULL, dc->arg);
 | 
			
		||||
		dc->fn((const EVP_CIPHER *)nm->data, nm->name, NULL, dc->arg);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void EVP_CIPHER_do_all(void (*fn)(const EVP_CIPHER *ciph,
 | 
			
		||||
@@ -179,7 +179,7 @@ static void do_all_md_fn(const OBJ_NAME *nm, void *arg)
 | 
			
		||||
	if (nm->alias)
 | 
			
		||||
		dc->fn(NULL, nm->name, nm->data, dc->arg);
 | 
			
		||||
	else
 | 
			
		||||
		dc->fn((const EVP_MD *)nm->data, NULL, NULL, dc->arg);
 | 
			
		||||
		dc->fn((const EVP_MD *)nm->data, nm->name, NULL, dc->arg);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
void EVP_MD_do_all(void (*fn)(const EVP_MD *md,
 | 
			
		||||
 
 | 
			
		||||
@@ -285,13 +285,13 @@ int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx)
 | 
			
		||||
int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer)
 | 
			
		||||
	{
 | 
			
		||||
	int ret;
 | 
			
		||||
	if (!ctx || !ctx->pmeth || !(ctx->pmeth->derive||ctx->pmeth->encrypt) || !ctx->pmeth->ctrl)
 | 
			
		||||
	if (!ctx || !ctx->pmeth || !(ctx->pmeth->derive||ctx->pmeth->encrypt||ctx->pmeth->decrypt) || !ctx->pmeth->ctrl)
 | 
			
		||||
		{
 | 
			
		||||
		EVPerr(EVP_F_EVP_PKEY_DERIVE_SET_PEER,
 | 
			
		||||
			EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
 | 
			
		||||
		return -2;
 | 
			
		||||
		}
 | 
			
		||||
	if (ctx->operation != EVP_PKEY_OP_DERIVE && ctx->operation != EVP_PKEY_OP_ENCRYPT)
 | 
			
		||||
	if (ctx->operation != EVP_PKEY_OP_DERIVE && ctx->operation != EVP_PKEY_OP_ENCRYPT && ctx->operation != EVP_PKEY_OP_DECRYPT)
 | 
			
		||||
		{
 | 
			
		||||
		EVPerr(EVP_F_EVP_PKEY_DERIVE_SET_PEER,
 | 
			
		||||
					EVP_R_OPERATON_NOT_INITIALIZED);
 | 
			
		||||
@@ -319,6 +319,11 @@ int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer)
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	/* ran@cryptocom.ru: For clarity.  The error is if parameters in peer are
 | 
			
		||||
	 * present (!missing) but don't match.  EVP_PKEY_cmp_parameters may return
 | 
			
		||||
	 * 1 (match), 0 (don't match) and -2 (comparison is not defined).  -1
 | 
			
		||||
	 * (different key types) is impossible here because it is checked earlier.
 | 
			
		||||
	 * -2 is OK for us here, as well as 1, so we can check for 0 only. */
 | 
			
		||||
	if (!EVP_PKEY_missing_parameters(peer) &&
 | 
			
		||||
		!EVP_PKEY_cmp_parameters(ctx->pkey, peer))
 | 
			
		||||
		{
 | 
			
		||||
@@ -327,6 +332,8 @@ int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer)
 | 
			
		||||
		return -1;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (ctx->peerkey)
 | 
			
		||||
		EVP_PKEY_free(ctx->peerkey);
 | 
			
		||||
	ctx->peerkey = peer;
 | 
			
		||||
 | 
			
		||||
	ret = ctx->pmeth->ctrl(ctx, EVP_PKEY_CTRL_PEER_KEY, 1, peer);
 | 
			
		||||
 
 | 
			
		||||
@@ -77,10 +77,18 @@ extern const EVP_PKEY_METHOD ec_pkey_meth, hmac_pkey_meth;
 | 
			
		||||
 | 
			
		||||
static const EVP_PKEY_METHOD *standard_methods[] =
 | 
			
		||||
	{
 | 
			
		||||
#ifndef OPENSSL_NO_RSA
 | 
			
		||||
	&rsa_pkey_meth,
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_DH
 | 
			
		||||
	&dh_pkey_meth,
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_DSA
 | 
			
		||||
	&dsa_pkey_meth,
 | 
			
		||||
#endif
 | 
			
		||||
#ifndef OPENSSL_NO_EC
 | 
			
		||||
	&ec_pkey_meth,
 | 
			
		||||
#endif
 | 
			
		||||
	&hmac_pkey_meth,
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,10 +8,19 @@ $!
 | 
			
		||||
$	IF P1 .EQS. ""
 | 
			
		||||
$	THEN
 | 
			
		||||
$	    WRITE SYS$OUTPUT "First argument missing."
 | 
			
		||||
$	    WRITE SYS$OUTPUT "Should be the directory where you want things installed."
 | 
			
		||||
$	    WRITE SYS$OUTPUT -
 | 
			
		||||
		  "It should be the directory where you want things installed."
 | 
			
		||||
$	    EXIT
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$
 | 
			
		||||
$	IF (F$GETSYI("CPU").LT.128)
 | 
			
		||||
$	THEN
 | 
			
		||||
$	    ARCH := VAX
 | 
			
		||||
$	ELSE
 | 
			
		||||
$	    ARCH = F$EDIT( F$GETSYI( "ARCH_NAME"), "UPCASE")
 | 
			
		||||
$	    IF (ARCH .EQS. "") THEN ARCH = "UNK"
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$
 | 
			
		||||
$	ROOT = F$PARSE(P1,"[]A.;0",,,"SYNTAX_ONLY,NO_CONCEAL") - "A.;0"
 | 
			
		||||
$	ROOT_DEV = F$PARSE(ROOT,,,"DEVICE","SYNTAX_ONLY")
 | 
			
		||||
$	ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
 | 
			
		||||
@@ -19,16 +28,13 @@ $	ROOT_DIR = F$PARSE(ROOT,,,"DIRECTORY","SYNTAX_ONLY") -
 | 
			
		||||
$	ROOT = ROOT_DEV + "[" + ROOT_DIR
 | 
			
		||||
$
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLROOT 'ROOT'.] /TRANS=CONC
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLVLIB WRK_SSLROOT:[VAX_LIB]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLALIB WRK_SSLROOT:[ALPHA_LIB]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLLIB WRK_SSLROOT:['ARCH'_LIB]
 | 
			
		||||
$	DEFINE/NOLOG WRK_SSLINCLUDE WRK_SSLROOT:[INCLUDE]
 | 
			
		||||
$
 | 
			
		||||
$	IF F$PARSE("WRK_SSLROOT:[000000]") .EQS. "" THEN -
 | 
			
		||||
	   CREATE/DIR/LOG WRK_SSLROOT:[000000]
 | 
			
		||||
$	IF F$PARSE("WRK_SSLVLIB:") .EQS. "" THEN -
 | 
			
		||||
	   CREATE/DIR/LOG WRK_SSLVLIB:
 | 
			
		||||
$	IF F$PARSE("WRK_SSLALIB:") .EQS. "" THEN -
 | 
			
		||||
	   CREATE/DIR/LOG WRK_SSLALIB:
 | 
			
		||||
$	IF F$PARSE("WRK_SSLLIB:") .EQS. "" THEN -
 | 
			
		||||
	   CREATE/DIR/LOG WRK_SSLLIB:
 | 
			
		||||
$	IF F$PARSE("WRK_SSLINCLUDE:") .EQS. "" THEN -
 | 
			
		||||
	   CREATE/DIR/LOG WRK_SSLINCLUDE:
 | 
			
		||||
$
 | 
			
		||||
@@ -126,25 +132,14 @@ $	IF E .EQS. "," THEN GOTO LOOP_LIB_END
 | 
			
		||||
$	SET NOON
 | 
			
		||||
$	IF F$SEARCH(VEXE_DIR+E+".OLB") .NES. ""
 | 
			
		||||
$	THEN
 | 
			
		||||
$	  COPY 'VEXE_DIR''E'.OLB WRK_SSLVLIB:'E'.OLB/log
 | 
			
		||||
$	  SET FILE/PROT=W:RE WRK_SSLVLIB:'E'.OLB
 | 
			
		||||
$	  COPY 'VEXE_DIR''E'.OLB WRK_SSLLIB:'E'.OLB/log
 | 
			
		||||
$	  SET FILE/PROT=W:RE WRK_SSLLIB:'E'.OLB
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$	! Preparing for the time when we have shareable images
 | 
			
		||||
$	IF F$SEARCH(VEXE_DIR+E+".EXE") .NES. ""
 | 
			
		||||
$	THEN
 | 
			
		||||
$	  COPY 'VEXE_DIR''E'.EXE WRK_SSLVLIB:'E'.EXE/log
 | 
			
		||||
$	  SET FILE/PROT=W:RE WRK_SSLVLIB:'E'.EXE
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$	IF F$SEARCH(AEXE_DIR+E+".OLB") .NES. ""
 | 
			
		||||
$	THEN
 | 
			
		||||
$	  COPY 'AEXE_DIR''E'.OLB WRK_SSLALIB:'E'.OLB/log
 | 
			
		||||
$	  SET FILE/PROT=W:RE WRK_SSLALIB:'E'.OLB
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$	! Preparing for the time when we have shareable images
 | 
			
		||||
$	IF F$SEARCH(AEXE_DIR+E+".EXE") .NES. ""
 | 
			
		||||
$	THEN
 | 
			
		||||
$	  COPY 'AEXE_DIR''E'.EXE WRK_SSLALIB:'E'.EXE/log
 | 
			
		||||
$	  SET FILE/PROT=W:RE WRK_SSLALIB:'E'.EXE
 | 
			
		||||
$	  COPY 'VEXE_DIR''E'.EXE WRK_SSLLIB:'E'.EXE/log
 | 
			
		||||
$	  SET FILE/PROT=W:RE WRK_SSLLIB:'E'.EXE
 | 
			
		||||
$	ENDIF
 | 
			
		||||
$	SET ON
 | 
			
		||||
$	GOTO LOOP_LIB
 | 
			
		||||
 
 | 
			
		||||
@@ -787,7 +787,7 @@ void CRYPTO_mem_leaks(BIO *b)
 | 
			
		||||
		 * XXX    This should be in CRYPTO_mem_leaks_cb,
 | 
			
		||||
		 * and CRYPTO_mem_leaks should be implemented by
 | 
			
		||||
		 * using CRYPTO_mem_leaks_cb.
 | 
			
		||||
		 * (Also their should be a variant of lh_doall_arg
 | 
			
		||||
		 * (Also there should be a variant of lh_doall_arg
 | 
			
		||||
		 * that takes a function pointer instead of a void *;
 | 
			
		||||
		 * this would obviate the ugly and illegal
 | 
			
		||||
		 * void_fn_to_char kludge in CRYPTO_mem_leaks_cb.
 | 
			
		||||
 
 | 
			
		||||
@@ -60,7 +60,9 @@
 | 
			
		||||
#include <e_os.h>
 | 
			
		||||
#include "o_str.h"
 | 
			
		||||
 | 
			
		||||
#if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && !defined(OPENSSL_SYSNAME_WIN32)
 | 
			
		||||
#if !defined(OPENSSL_IMPLEMENTS_strncasecmp) && \
 | 
			
		||||
    !defined(OPENSSL_SYSNAME_WIN32) && \
 | 
			
		||||
    !defined(NETWARE_CLIB)
 | 
			
		||||
# include <strings.h>
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1054,24 +1054,34 @@ const void *	OBJ_bsearch_ex_(const void *key,const void *base,int num,
 | 
			
		||||
 * the non-constness means a lot of complication, and in practice
 | 
			
		||||
 * comparison routines do always not touch their arguments.
 | 
			
		||||
 */
 | 
			
		||||
#define _IMPLEMENT_OBJ_BSEARCH_CMP_FN(scope, type1, type2, nm)	\
 | 
			
		||||
 | 
			
		||||
#define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm)	\
 | 
			
		||||
  static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_)	\
 | 
			
		||||
      { \
 | 
			
		||||
      type1 const *a = a_; \
 | 
			
		||||
      type2 const *b = b_; \
 | 
			
		||||
      return nm##_cmp(a,b); \
 | 
			
		||||
      } \
 | 
			
		||||
  scope type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
 | 
			
		||||
  static type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
 | 
			
		||||
      { \
 | 
			
		||||
      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
 | 
			
		||||
					nm##_cmp_BSEARCH_CMP_FN); \
 | 
			
		||||
      } \
 | 
			
		||||
      extern void dummy_prototype(void)
 | 
			
		||||
 | 
			
		||||
#define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, cmp) \
 | 
			
		||||
  _IMPLEMENT_OBJ_BSEARCH_CMP_FN(static, type1, type2, cmp)
 | 
			
		||||
#define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, cmp)	\
 | 
			
		||||
  _IMPLEMENT_OBJ_BSEARCH_CMP_FN(, type1, type2, cmp)
 | 
			
		||||
#define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm)	\
 | 
			
		||||
  static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_)	\
 | 
			
		||||
      { \
 | 
			
		||||
      type1 const *a = a_; \
 | 
			
		||||
      type2 const *b = b_; \
 | 
			
		||||
      return nm##_cmp(a,b); \
 | 
			
		||||
      } \
 | 
			
		||||
  type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \
 | 
			
		||||
      { \
 | 
			
		||||
      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \
 | 
			
		||||
					nm##_cmp_BSEARCH_CMP_FN); \
 | 
			
		||||
      } \
 | 
			
		||||
      extern void dummy_prototype(void)
 | 
			
		||||
 | 
			
		||||
#define OBJ_bsearch(type1,key,type2,base,num,cmp)			       \
 | 
			
		||||
  ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \
 | 
			
		||||
 
 | 
			
		||||
@@ -55,9 +55,12 @@ my @srt2 = sort
 | 
			
		||||
	return $ap2 - $bp2;
 | 
			
		||||
	} @xrkeys;
 | 
			
		||||
 | 
			
		||||
my $pname = $0;
 | 
			
		||||
 | 
			
		||||
$pname =~ s|^.[^/]/||;
 | 
			
		||||
 | 
			
		||||
print <<EOF;
 | 
			
		||||
/* AUTOGENERATED BY $0, DO NOT EDIT */
 | 
			
		||||
/* AUTOGENERATED BY $pname, DO NOT EDIT */
 | 
			
		||||
 | 
			
		||||
typedef struct
 | 
			
		||||
	{
 | 
			
		||||
 
 | 
			
		||||
@@ -25,11 +25,11 @@
 | 
			
		||||
 * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
 | 
			
		||||
 *  major minor fix final patch/beta)
 | 
			
		||||
 */
 | 
			
		||||
#define OPENSSL_VERSION_NUMBER	0x10100000L
 | 
			
		||||
#define OPENSSL_VERSION_NUMBER	0x10000003L
 | 
			
		||||
#ifdef OPENSSL_FIPS
 | 
			
		||||
#define OPENSSL_VERSION_TEXT	"OpenSSL 1.1.0-fips-dev xx XXX xxxx"
 | 
			
		||||
#define OPENSSL_VERSION_TEXT	"OpenSSL 1.0.0-fips-beta3 15 Jul 2009"
 | 
			
		||||
#else
 | 
			
		||||
#define OPENSSL_VERSION_TEXT	"OpenSSL 1.1.0-dev xx XXX xxxx"
 | 
			
		||||
#define OPENSSL_VERSION_TEXT	"OpenSSL 1.0.0-beta3 15 Jul 2009"
 | 
			
		||||
#endif
 | 
			
		||||
#define OPENSSL_VERSION_PTEXT	" part of " OPENSSL_VERSION_TEXT
 | 
			
		||||
 | 
			
		||||
@@ -83,7 +83,7 @@
 | 
			
		||||
 * should only keep the versions that are binary compatible with the current.
 | 
			
		||||
 */
 | 
			
		||||
#define SHLIB_VERSION_HISTORY ""
 | 
			
		||||
#define SHLIB_VERSION_NUMBER "1.1.0"
 | 
			
		||||
#define SHLIB_VERSION_NUMBER "1.0.0"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#endif /* HEADER_OPENSSLV_H */
 | 
			
		||||
 
 | 
			
		||||
@@ -63,6 +63,7 @@
 | 
			
		||||
#include <openssl/pem.h>
 | 
			
		||||
#include <openssl/rand.h>
 | 
			
		||||
#include <openssl/bn.h>
 | 
			
		||||
#if !defined(OPENSSL_NO_RSA) && !defined(OPENSSL_NO_DSA)
 | 
			
		||||
#include <openssl/dsa.h>
 | 
			
		||||
#include <openssl/rsa.h>
 | 
			
		||||
 | 
			
		||||
@@ -933,3 +934,4 @@ int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,
 | 
			
		||||
		}
 | 
			
		||||
	return -1;
 | 
			
		||||
	}
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -575,8 +575,8 @@ my %globals;
 | 
			
		||||
				    my @arr = split(',',$line);
 | 
			
		||||
				    my $last = pop(@arr);
 | 
			
		||||
				    my $conv = sub  {	my $var=shift;
 | 
			
		||||
							$var=~s/(0b[0-1]+)/oct($1)/eig;
 | 
			
		||||
							$var=~s/0x([0-9a-f]+)/0$1h/ig if ($masm);
 | 
			
		||||
							$var=~s/^(0b[0-1]+)/oct($1)/eig;
 | 
			
		||||
							$var=~s/^0x([0-9a-f]+)/0$1h/ig if ($masm);
 | 
			
		||||
							if ($sz eq "D" && ($current_segment=~/.[px]data/ || $dir eq ".rva"))
 | 
			
		||||
							{ $var=~s/([_a-z\$\@][_a-z0-9\$\@]*)/$nasm?"$1 wrt ..imagebase":"imagerel $1"/egi; }
 | 
			
		||||
							$var;
 | 
			
		||||
@@ -662,6 +662,7 @@ while($line=<>) {
 | 
			
		||||
		$insn = $opcode->out($#args>=1?$args[$#args]->size():$sz);
 | 
			
		||||
	    } else {
 | 
			
		||||
		$insn = $opcode->out();
 | 
			
		||||
		$insn .= $sz if (map($_->out() =~ /xmm|mmx/,@args));
 | 
			
		||||
		@args = reverse(@args);
 | 
			
		||||
		undef $sz if ($nasm && $opcode->mnemonic() eq "lea");
 | 
			
		||||
	    }
 | 
			
		||||
@@ -831,6 +832,7 @@ close STDOUT;
 | 
			
		||||
#	CONTEXT.R14				232
 | 
			
		||||
#	CONTEXT.R15				240
 | 
			
		||||
#	CONTEXT.Rip				248
 | 
			
		||||
#	CONTEXT.Xmm6				512
 | 
			
		||||
#	sizeof(CONTEXT)				1232
 | 
			
		||||
#	DISPATCHER_CONTEXT.ControlPc		0
 | 
			
		||||
#	DISPATCHER_CONTEXT.ImageBase		8
 | 
			
		||||
 
 | 
			
		||||
@@ -16,9 +16,11 @@ sub ::generic
 | 
			
		||||
    # fix hexadecimal constants
 | 
			
		||||
    for (@arg) { s/0x([0-9a-f]+)/0$1h/oi; }
 | 
			
		||||
 | 
			
		||||
    # fix xmm references
 | 
			
		||||
    $arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[1]=~/\bxmm[0-7]\b/i);
 | 
			
		||||
    $arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i);
 | 
			
		||||
    if ($opcode !~ /movq/)
 | 
			
		||||
    {	# fix xmm references
 | 
			
		||||
	$arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[1]=~/\bxmm[0-7]\b/i);
 | 
			
		||||
	$arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    &::emit($opcode,@arg);
 | 
			
		||||
  1;
 | 
			
		||||
 
 | 
			
		||||
@@ -139,7 +139,7 @@ char *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag)
 | 
			
		||||
	ASN1_TYPE *atype;
 | 
			
		||||
	if (!(atype = PKCS12_get_attr(bag, NID_friendlyName))) return NULL;
 | 
			
		||||
	if (atype->type != V_ASN1_BMPSTRING) return NULL;
 | 
			
		||||
	return uni2asc(atype->value.bmpstring->data,
 | 
			
		||||
	return OPENSSL_uni2asc(atype->value.bmpstring->data,
 | 
			
		||||
				 atype->value.bmpstring->length);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -85,7 +85,7 @@ int PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,
 | 
			
		||||
	if(!pass) {
 | 
			
		||||
		unipass = NULL;
 | 
			
		||||
		uniplen = 0;
 | 
			
		||||
	} else if (!asc2uni(pass, passlen, &unipass, &uniplen)) {
 | 
			
		||||
	} else if (!OPENSSL_asc2uni(pass, passlen, &unipass, &uniplen)) {
 | 
			
		||||
		PKCS12err(PKCS12_F_PKCS12_KEY_GEN_ASC,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -63,16 +63,13 @@
 | 
			
		||||
/* Simplified PKCS#12 routines */
 | 
			
		||||
 | 
			
		||||
static int parse_pk12( PKCS12 *p12, const char *pass, int passlen,
 | 
			
		||||
		EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca);
 | 
			
		||||
		EVP_PKEY **pkey, STACK_OF(X509) *ocerts);
 | 
			
		||||
 | 
			
		||||
static int parse_bags( STACK_OF(PKCS12_SAFEBAG) *bags, const char *pass,
 | 
			
		||||
		       int passlen, EVP_PKEY **pkey, X509 **cert,
 | 
			
		||||
		       STACK_OF(X509) **ca, ASN1_OCTET_STRING **keyid,
 | 
			
		||||
		       char *keymatch);
 | 
			
		||||
		       int passlen, EVP_PKEY **pkey, STACK_OF(X509) *ocerts);
 | 
			
		||||
 | 
			
		||||
static int parse_bag( PKCS12_SAFEBAG *bag, const char *pass, int passlen,
 | 
			
		||||
			EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca,
 | 
			
		||||
			ASN1_OCTET_STRING **keyid, char *keymatch);
 | 
			
		||||
			EVP_PKEY **pkey, STACK_OF(X509) *ocerts);
 | 
			
		||||
 | 
			
		||||
/* Parse and decrypt a PKCS#12 structure returning user key, user cert
 | 
			
		||||
 * and other (CA) certs. Note either ca should be NULL, *ca should be NULL,
 | 
			
		||||
@@ -83,24 +80,20 @@ static int parse_bag( PKCS12_SAFEBAG *bag, const char *pass, int passlen,
 | 
			
		||||
int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
 | 
			
		||||
	     STACK_OF(X509) **ca)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
	STACK_OF(X509) *ocerts = NULL;
 | 
			
		||||
	X509 *x = NULL;
 | 
			
		||||
	/* Check for NULL PKCS12 structure */
 | 
			
		||||
 | 
			
		||||
	if(!p12) {
 | 
			
		||||
	if(!p12)
 | 
			
		||||
		{
 | 
			
		||||
		PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_INVALID_NULL_PKCS12_POINTER);
 | 
			
		||||
		return 0;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Allocate stack for ca certificates if needed */
 | 
			
		||||
	if ((ca != NULL) && (*ca == NULL)) {
 | 
			
		||||
		if (!(*ca = sk_X509_new_null())) {
 | 
			
		||||
			PKCS12err(PKCS12_F_PKCS12_PARSE,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
			return 0;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if(pkey) *pkey = NULL;
 | 
			
		||||
	if(cert) *cert = NULL;
 | 
			
		||||
	if(pkey)
 | 
			
		||||
		*pkey = NULL;
 | 
			
		||||
	if(cert)
 | 
			
		||||
		*cert = NULL;
 | 
			
		||||
 | 
			
		||||
	/* Check the mac */
 | 
			
		||||
 | 
			
		||||
@@ -122,19 +115,61 @@ int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
 | 
			
		||||
		goto err;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (!parse_pk12 (p12, pass, -1, pkey, cert, ca))
 | 
			
		||||
	/* Allocate stack for other certificates */
 | 
			
		||||
	ocerts = sk_X509_new_null();
 | 
			
		||||
 | 
			
		||||
	if (!ocerts)
 | 
			
		||||
		{
 | 
			
		||||
		PKCS12err(PKCS12_F_PKCS12_PARSE,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
		return 0;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (!parse_pk12 (p12, pass, -1, pkey, ocerts))
 | 
			
		||||
		{
 | 
			
		||||
		PKCS12err(PKCS12_F_PKCS12_PARSE,PKCS12_R_PARSE_ERROR);
 | 
			
		||||
		goto err;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	while ((x = sk_X509_pop(ocerts)))
 | 
			
		||||
		{
 | 
			
		||||
		if (pkey && *pkey && cert && !*cert)
 | 
			
		||||
			{
 | 
			
		||||
			if (X509_check_private_key(x, *pkey))
 | 
			
		||||
				{
 | 
			
		||||
				*cert = x;
 | 
			
		||||
				x = NULL;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (ca && x)
 | 
			
		||||
			{
 | 
			
		||||
			if (!*ca)
 | 
			
		||||
				*ca = sk_X509_new_null();
 | 
			
		||||
			if (!*ca)
 | 
			
		||||
				goto err;
 | 
			
		||||
			if (!sk_X509_push(*ca, x))
 | 
			
		||||
				goto err;
 | 
			
		||||
			x = NULL;
 | 
			
		||||
			}
 | 
			
		||||
		if (x)
 | 
			
		||||
			X509_free(x);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	if (ocerts)
 | 
			
		||||
		sk_X509_pop_free(ocerts, X509_free);
 | 
			
		||||
 | 
			
		||||
	return 1;
 | 
			
		||||
 | 
			
		||||
 err:
 | 
			
		||||
 | 
			
		||||
	if (pkey && *pkey) EVP_PKEY_free(*pkey);
 | 
			
		||||
	if (cert && *cert) X509_free(*cert);
 | 
			
		||||
	if (ca) sk_X509_pop_free(*ca, X509_free);
 | 
			
		||||
	if (pkey && *pkey)
 | 
			
		||||
		EVP_PKEY_free(*pkey);
 | 
			
		||||
	if (cert && *cert)
 | 
			
		||||
		X509_free(*cert);
 | 
			
		||||
	if (x)
 | 
			
		||||
		X509_free(*cert);
 | 
			
		||||
	if (ocerts)
 | 
			
		||||
		sk_X509_pop_free(ocerts, X509_free);
 | 
			
		||||
	return 0;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -142,15 +177,13 @@ int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,
 | 
			
		||||
/* Parse the outer PKCS#12 structure */
 | 
			
		||||
 | 
			
		||||
static int parse_pk12(PKCS12 *p12, const char *pass, int passlen,
 | 
			
		||||
	     EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca)
 | 
			
		||||
	     EVP_PKEY **pkey, STACK_OF(X509) *ocerts)
 | 
			
		||||
{
 | 
			
		||||
	STACK_OF(PKCS7) *asafes;
 | 
			
		||||
	STACK_OF(PKCS12_SAFEBAG) *bags;
 | 
			
		||||
	int i, bagnid;
 | 
			
		||||
	PKCS7 *p7;
 | 
			
		||||
	ASN1_OCTET_STRING *keyid = NULL;
 | 
			
		||||
 | 
			
		||||
	char keymatch = 0;
 | 
			
		||||
	if (!(asafes = PKCS12_unpack_authsafes (p12))) return 0;
 | 
			
		||||
	for (i = 0; i < sk_PKCS7_num (asafes); i++) {
 | 
			
		||||
		p7 = sk_PKCS7_value (asafes, i);
 | 
			
		||||
@@ -164,8 +197,7 @@ static int parse_pk12(PKCS12 *p12, const char *pass, int passlen,
 | 
			
		||||
			sk_PKCS7_pop_free(asafes, PKCS7_free);
 | 
			
		||||
			return 0;
 | 
			
		||||
		}
 | 
			
		||||
	    	if (!parse_bags(bags, pass, passlen, pkey, cert, ca,
 | 
			
		||||
							 &keyid, &keymatch)) {
 | 
			
		||||
	    	if (!parse_bags(bags, pass, passlen, pkey, ocerts)) {
 | 
			
		||||
			sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
 | 
			
		||||
			sk_PKCS7_pop_free(asafes, PKCS7_free);
 | 
			
		||||
			return 0;
 | 
			
		||||
@@ -173,89 +205,65 @@ static int parse_pk12(PKCS12 *p12, const char *pass, int passlen,
 | 
			
		||||
		sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
 | 
			
		||||
	}
 | 
			
		||||
	sk_PKCS7_pop_free(asafes, PKCS7_free);
 | 
			
		||||
	if (keyid) M_ASN1_OCTET_STRING_free(keyid);
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
static int parse_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *pass,
 | 
			
		||||
		      int passlen, EVP_PKEY **pkey, X509 **cert,
 | 
			
		||||
		      STACK_OF(X509) **ca, ASN1_OCTET_STRING **keyid,
 | 
			
		||||
		      char *keymatch)
 | 
			
		||||
		      int passlen, EVP_PKEY **pkey, STACK_OF(X509) *ocerts)
 | 
			
		||||
{
 | 
			
		||||
	int i;
 | 
			
		||||
	for (i = 0; i < sk_PKCS12_SAFEBAG_num(bags); i++) {
 | 
			
		||||
		if (!parse_bag(sk_PKCS12_SAFEBAG_value (bags, i),
 | 
			
		||||
			 pass, passlen, pkey, cert, ca, keyid,
 | 
			
		||||
							 keymatch)) return 0;
 | 
			
		||||
				 pass, passlen, pkey, ocerts))
 | 
			
		||||
			return 0;
 | 
			
		||||
	}
 | 
			
		||||
	return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define MATCH_KEY  0x1
 | 
			
		||||
#define MATCH_CERT 0x2
 | 
			
		||||
#define MATCH_ALL  0x3
 | 
			
		||||
 | 
			
		||||
static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen,
 | 
			
		||||
		     EVP_PKEY **pkey, X509 **cert, STACK_OF(X509) **ca,
 | 
			
		||||
		     ASN1_OCTET_STRING **keyid,
 | 
			
		||||
		     char *keymatch)
 | 
			
		||||
		     EVP_PKEY **pkey, STACK_OF(X509) *ocerts)
 | 
			
		||||
{
 | 
			
		||||
	PKCS8_PRIV_KEY_INFO *p8;
 | 
			
		||||
	X509 *x509;
 | 
			
		||||
	ASN1_OCTET_STRING *lkey = NULL, *ckid = NULL;
 | 
			
		||||
	ASN1_TYPE *attrib;
 | 
			
		||||
	ASN1_BMPSTRING *fname = NULL;
 | 
			
		||||
	ASN1_OCTET_STRING *lkid = NULL;
 | 
			
		||||
 | 
			
		||||
	if ((attrib = PKCS12_get_attr (bag, NID_friendlyName)))
 | 
			
		||||
		fname = attrib->value.bmpstring;
 | 
			
		||||
 | 
			
		||||
	if ((attrib = PKCS12_get_attr (bag, NID_localKeyID))) {
 | 
			
		||||
		lkey = attrib->value.octet_string;
 | 
			
		||||
		ckid = lkey;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Check for any local key id matching (if needed) */
 | 
			
		||||
	if (lkey && ((*keymatch & MATCH_ALL) != MATCH_ALL)) {
 | 
			
		||||
		if (*keyid) {
 | 
			
		||||
			if (M_ASN1_OCTET_STRING_cmp(*keyid, lkey)) lkey = NULL;
 | 
			
		||||
		} else {
 | 
			
		||||
			if (!(*keyid = M_ASN1_OCTET_STRING_dup(lkey))) {
 | 
			
		||||
				PKCS12err(PKCS12_F_PARSE_BAG,ERR_R_MALLOC_FAILURE);
 | 
			
		||||
				return 0;
 | 
			
		||||
		    }
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if ((attrib = PKCS12_get_attr (bag, NID_localKeyID)))
 | 
			
		||||
		lkid = attrib->value.octet_string;
 | 
			
		||||
 | 
			
		||||
	switch (M_PKCS12_bag_type(bag))
 | 
			
		||||
	{
 | 
			
		||||
	case NID_keyBag:
 | 
			
		||||
		if (!lkey || !pkey) return 1;	
 | 
			
		||||
		if (!(*pkey = EVP_PKCS82PKEY(bag->value.keybag))) return 0;
 | 
			
		||||
		*keymatch |= MATCH_KEY;
 | 
			
		||||
		if (!pkey || *pkey)
 | 
			
		||||
			return 1;	
 | 
			
		||||
		if (!(*pkey = EVP_PKCS82PKEY(bag->value.keybag)))
 | 
			
		||||
			return 0;
 | 
			
		||||
	break;
 | 
			
		||||
 | 
			
		||||
	case NID_pkcs8ShroudedKeyBag:
 | 
			
		||||
		if (!lkey || !pkey) return 1;	
 | 
			
		||||
		if (!pkey || *pkey)
 | 
			
		||||
			return 1;	
 | 
			
		||||
		if (!(p8 = PKCS12_decrypt_skey(bag, pass, passlen)))
 | 
			
		||||
				return 0;
 | 
			
		||||
		*pkey = EVP_PKCS82PKEY(p8);
 | 
			
		||||
		PKCS8_PRIV_KEY_INFO_free(p8);
 | 
			
		||||
		if (!(*pkey)) return 0;
 | 
			
		||||
		*keymatch |= MATCH_KEY;
 | 
			
		||||
	break;
 | 
			
		||||
 | 
			
		||||
	case NID_certBag:
 | 
			
		||||
		if (M_PKCS12_cert_bag_type(bag) != NID_x509Certificate )
 | 
			
		||||
								 return 1;
 | 
			
		||||
		if (!(x509 = PKCS12_certbag2x509(bag))) return 0;
 | 
			
		||||
		if(ckid)
 | 
			
		||||
			return 1;
 | 
			
		||||
		if (!(x509 = PKCS12_certbag2x509(bag)))
 | 
			
		||||
			return 0;
 | 
			
		||||
		if(lkid && !X509_keyid_set1(x509, lkid->data, lkid->length))
 | 
			
		||||
			{
 | 
			
		||||
			if (!X509_keyid_set1(x509, ckid->data, ckid->length))
 | 
			
		||||
				{
 | 
			
		||||
				X509_free(x509);
 | 
			
		||||
				return 0;
 | 
			
		||||
				}
 | 
			
		||||
			X509_free(x509);
 | 
			
		||||
			return 0;
 | 
			
		||||
			}
 | 
			
		||||
		if(fname) {
 | 
			
		||||
			int len, r;
 | 
			
		||||
@@ -272,20 +280,17 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen,
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if(!sk_X509_push(ocerts, x509))
 | 
			
		||||
			{
 | 
			
		||||
			X509_free(x509);
 | 
			
		||||
			return 0;
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
		if (lkey) {
 | 
			
		||||
			*keymatch |= MATCH_CERT;
 | 
			
		||||
			if (cert) *cert = x509;
 | 
			
		||||
			else X509_free(x509);
 | 
			
		||||
		} else {
 | 
			
		||||
			if(ca) sk_X509_push (*ca, x509);
 | 
			
		||||
			else X509_free(x509);
 | 
			
		||||
		}
 | 
			
		||||
	break;
 | 
			
		||||
 | 
			
		||||
	case NID_safeContentsBag:
 | 
			
		||||
		return parse_bags(bag->value.safes, pass, passlen,
 | 
			
		||||
			 		pkey, cert, ca, keyid, keymatch);
 | 
			
		||||
			 		pkey, ocerts);
 | 
			
		||||
	break;
 | 
			
		||||
 | 
			
		||||
	default:
 | 
			
		||||
 
 | 
			
		||||
@@ -62,7 +62,7 @@
 | 
			
		||||
 | 
			
		||||
/* Cheap and nasty Unicode stuff */
 | 
			
		||||
 | 
			
		||||
unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen)
 | 
			
		||||
unsigned char *OPENSSL_asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen)
 | 
			
		||||
{
 | 
			
		||||
	int ulen, i;
 | 
			
		||||
	unsigned char *unitmp;
 | 
			
		||||
@@ -81,7 +81,7 @@ unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *un
 | 
			
		||||
	return unitmp;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
char *uni2asc(unsigned char *uni, int unilen)
 | 
			
		||||
char *OPENSSL_uni2asc(unsigned char *uni, int unilen)
 | 
			
		||||
{
 | 
			
		||||
	int asclen, i;
 | 
			
		||||
	char *asctmp;
 | 
			
		||||
 
 | 
			
		||||
@@ -230,8 +230,8 @@ int PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,
 | 
			
		||||
		   const EVP_MD *md_type);
 | 
			
		||||
int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,
 | 
			
		||||
					 int saltlen, const EVP_MD *md_type);
 | 
			
		||||
unsigned char *asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen);
 | 
			
		||||
char *uni2asc(unsigned char *uni, int unilen);
 | 
			
		||||
unsigned char *OPENSSL_asc2uni(const char *asc, int asclen, unsigned char **uni, int *unilen);
 | 
			
		||||
char *OPENSSL_uni2asc(unsigned char *uni, int unilen);
 | 
			
		||||
 | 
			
		||||
DECLARE_ASN1_FUNCTIONS(PKCS12)
 | 
			
		||||
DECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)
 | 
			
		||||
 
 | 
			
		||||
@@ -237,3 +237,17 @@ pqueue_next(pitem **item)
 | 
			
		||||
 | 
			
		||||
	return ret;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
pqueue_size(pqueue_s *pq)
 | 
			
		||||
{
 | 
			
		||||
	pitem *item = pq->items;
 | 
			
		||||
	int count = 0;
 | 
			
		||||
	
 | 
			
		||||
	while(item != NULL)
 | 
			
		||||
	{
 | 
			
		||||
		count++;
 | 
			
		||||
		item = item->next;
 | 
			
		||||
	}
 | 
			
		||||
	return count;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -89,5 +89,6 @@ pitem *pqueue_iterator(pqueue pq);
 | 
			
		||||
pitem *pqueue_next(piterator *iter);
 | 
			
		||||
 | 
			
		||||
void   pqueue_print(pqueue pq);
 | 
			
		||||
int    pqueue_size(pqueue pq);
 | 
			
		||||
 | 
			
		||||
#endif /* ! HEADER_PQUEUE_H */
 | 
			
		||||
 
 | 
			
		||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user