summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkus <>2004-04-07 20:42:12 +0000
committermarkus <>2004-04-07 20:42:12 +0000
commitcbf88de39286be06cd20e0c65b6cb7633dce25a5 (patch)
treecb12a4cb9d300ed3fa5ac3bc6fdba7773235dfd4
parenta4ab668c13b41cdc59a6f7dc9cf6c88c39d2466b (diff)
parent00b426069b0dfa8f0d9b87308646e9684f45c515 (diff)
downloadopenbsd-cbf88de39286be06cd20e0c65b6cb7633dce25a5.tar.gz
openbsd-cbf88de39286be06cd20e0c65b6cb7633dce25a5.tar.bz2
openbsd-cbf88de39286be06cd20e0c65b6cb7633dce25a5.zip
This commit was generated by cvs2git to track changes on a CVS vendor
branch.
-rw-r--r--src/lib/libcrypto/rc5/rc5_locl.h207
-rw-r--r--src/lib/libcrypto/util/extract-names.pl2
-rw-r--r--src/lib/libssl/src/certs/expired/vsign3.pem18
-rw-r--r--src/lib/libssl/src/crypto/bn/asm/x86_64-gcc.c2
-rw-r--r--src/lib/libssl/src/crypto/rc5/rc5_locl.h207
-rw-r--r--src/lib/libssl/src/doc/apps/s_time.pod173
-rw-r--r--src/lib/libssl/src/doc/crypto/CONF_modules_free.pod47
-rw-r--r--src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod60
-rw-r--r--src/lib/libssl/src/doc/crypto/OPENSSL_config.pod82
-rw-r--r--src/lib/libssl/src/doc/crypto/OPENSSL_load_builtin_modules.pod51
-rw-r--r--src/lib/libssl/src/doc/crypto/d2i_DSAPublicKey.pod5
-rw-r--r--src/lib/libssl/src/os2/backwardify.pl32
-rw-r--r--src/lib/libssl/src/util/extract-names.pl2
13 files changed, 885 insertions, 3 deletions
diff --git a/src/lib/libcrypto/rc5/rc5_locl.h b/src/lib/libcrypto/rc5/rc5_locl.h
new file mode 100644
index 0000000000..f4ebc23004
--- /dev/null
+++ b/src/lib/libcrypto/rc5/rc5_locl.h
@@ -0,0 +1,207 @@
1/* crypto/rc5/rc5_locl.h */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdlib.h>
60
61#undef c2l
62#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
63 l|=((unsigned long)(*((c)++)))<< 8L, \
64 l|=((unsigned long)(*((c)++)))<<16L, \
65 l|=((unsigned long)(*((c)++)))<<24L)
66
67/* NOTE - c is not incremented as per c2l */
68#undef c2ln
69#define c2ln(c,l1,l2,n) { \
70 c+=n; \
71 l1=l2=0; \
72 switch (n) { \
73 case 8: l2 =((unsigned long)(*(--(c))))<<24L; \
74 case 7: l2|=((unsigned long)(*(--(c))))<<16L; \
75 case 6: l2|=((unsigned long)(*(--(c))))<< 8L; \
76 case 5: l2|=((unsigned long)(*(--(c)))); \
77 case 4: l1 =((unsigned long)(*(--(c))))<<24L; \
78 case 3: l1|=((unsigned long)(*(--(c))))<<16L; \
79 case 2: l1|=((unsigned long)(*(--(c))))<< 8L; \
80 case 1: l1|=((unsigned long)(*(--(c)))); \
81 } \
82 }
83
84#undef l2c
85#define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
86 *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
87 *((c)++)=(unsigned char)(((l)>>16L)&0xff), \
88 *((c)++)=(unsigned char)(((l)>>24L)&0xff))
89
90/* NOTE - c is not incremented as per l2c */
91#undef l2cn
92#define l2cn(l1,l2,c,n) { \
93 c+=n; \
94 switch (n) { \
95 case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); \
96 case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); \
97 case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); \
98 case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \
99 case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); \
100 case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); \
101 case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); \
102 case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \
103 } \
104 }
105
106/* NOTE - c is not incremented as per n2l */
107#define n2ln(c,l1,l2,n) { \
108 c+=n; \
109 l1=l2=0; \
110 switch (n) { \
111 case 8: l2 =((unsigned long)(*(--(c)))) ; \
112 case 7: l2|=((unsigned long)(*(--(c))))<< 8; \
113 case 6: l2|=((unsigned long)(*(--(c))))<<16; \
114 case 5: l2|=((unsigned long)(*(--(c))))<<24; \
115 case 4: l1 =((unsigned long)(*(--(c)))) ; \
116 case 3: l1|=((unsigned long)(*(--(c))))<< 8; \
117 case 2: l1|=((unsigned long)(*(--(c))))<<16; \
118 case 1: l1|=((unsigned long)(*(--(c))))<<24; \
119 } \
120 }
121
122/* NOTE - c is not incremented as per l2n */
123#define l2nn(l1,l2,c,n) { \
124 c+=n; \
125 switch (n) { \
126 case 8: *(--(c))=(unsigned char)(((l2) )&0xff); \
127 case 7: *(--(c))=(unsigned char)(((l2)>> 8)&0xff); \
128 case 6: *(--(c))=(unsigned char)(((l2)>>16)&0xff); \
129 case 5: *(--(c))=(unsigned char)(((l2)>>24)&0xff); \
130 case 4: *(--(c))=(unsigned char)(((l1) )&0xff); \
131 case 3: *(--(c))=(unsigned char)(((l1)>> 8)&0xff); \
132 case 2: *(--(c))=(unsigned char)(((l1)>>16)&0xff); \
133 case 1: *(--(c))=(unsigned char)(((l1)>>24)&0xff); \
134 } \
135 }
136
137#undef n2l
138#define n2l(c,l) (l =((unsigned long)(*((c)++)))<<24L, \
139 l|=((unsigned long)(*((c)++)))<<16L, \
140 l|=((unsigned long)(*((c)++)))<< 8L, \
141 l|=((unsigned long)(*((c)++))))
142
143#undef l2n
144#define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24L)&0xff), \
145 *((c)++)=(unsigned char)(((l)>>16L)&0xff), \
146 *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
147 *((c)++)=(unsigned char)(((l) )&0xff))
148
149#if defined(OPENSSL_SYS_WIN32) && defined(_MSC_VER)
150#define ROTATE_l32(a,n) _lrotl(a,n)
151#define ROTATE_r32(a,n) _lrotr(a,n)
152#elif defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC)
153# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
154# define ROTATE_l32(a,n) ({ register unsigned int ret; \
155 asm ("roll %%cl,%0" \
156 : "=r"(ret) \
157 : "c"(n),"0"(a) \
158 : "cc"); \
159 ret; \
160 })
161# define ROTATE_r32(a,n) ({ register unsigned int ret; \
162 asm ("rorl %%cl,%0" \
163 : "=r"(ret) \
164 : "c"(n),"0"(a) \
165 : "cc"); \
166 ret; \
167 })
168# endif
169#endif
170#ifndef ROTATE_l32
171#define ROTATE_l32(a,n) (((a)<<(n&0x1f))|(((a)&0xffffffff)>>(32-(n&0x1f))))
172#endif
173#ifndef ROTATE_r32
174#define ROTATE_r32(a,n) (((a)<<(32-(n&0x1f)))|(((a)&0xffffffff)>>(n&0x1f)))
175#endif
176
177#define RC5_32_MASK 0xffffffffL
178
179#define RC5_16_P 0xB7E1
180#define RC5_16_Q 0x9E37
181#define RC5_32_P 0xB7E15163L
182#define RC5_32_Q 0x9E3779B9L
183#define RC5_64_P 0xB7E151628AED2A6BLL
184#define RC5_64_Q 0x9E3779B97F4A7C15LL
185
186#define E_RC5_32(a,b,s,n) \
187 a^=b; \
188 a=ROTATE_l32(a,b); \
189 a+=s[n]; \
190 a&=RC5_32_MASK; \
191 b^=a; \
192 b=ROTATE_l32(b,a); \
193 b+=s[n+1]; \
194 b&=RC5_32_MASK;
195
196#define D_RC5_32(a,b,s,n) \
197 b-=s[n+1]; \
198 b&=RC5_32_MASK; \
199 b=ROTATE_r32(b,a); \
200 b^=a; \
201 a-=s[n]; \
202 a&=RC5_32_MASK; \
203 a=ROTATE_r32(a,b); \
204 a^=b;
205
206
207
diff --git a/src/lib/libcrypto/util/extract-names.pl b/src/lib/libcrypto/util/extract-names.pl
index 9f2ad5ef16..744a8e2324 100644
--- a/src/lib/libcrypto/util/extract-names.pl
+++ b/src/lib/libcrypto/util/extract-names.pl
@@ -10,6 +10,8 @@ while(<STDIN>) {
10 if (/ - /) { 10 if (/ - /) {
11 s/ - .*//; 11 s/ - .*//;
12 s/,[ \t]+/,/g; 12 s/,[ \t]+/,/g;
13 s/^[ \t]+//g;
14 s/[ \t]+$//g;
13 push @words, split ','; 15 push @words, split ',';
14 } 16 }
15 } 17 }
diff --git a/src/lib/libssl/src/certs/expired/vsign3.pem b/src/lib/libssl/src/certs/expired/vsign3.pem
new file mode 100644
index 0000000000..aa5bb4c1f3
--- /dev/null
+++ b/src/lib/libssl/src/certs/expired/vsign3.pem
@@ -0,0 +1,18 @@
1subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
2notBefore=Jan 29 00:00:00 1996 GMT
3notAfter=Jan 7 23:59:59 2004 GMT
4-----BEGIN CERTIFICATE-----
5MIICPTCCAaYCEQDknv3zOugOz6URPhmkJAIyMA0GCSqGSIb3DQEBAgUAMF8xCzAJ
6BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh
7c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05
8NjAxMjkwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD
9VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJp
10bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB
11jQAwgYkCgYEAyVxZnvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqo
12RAWq7AMfeH+ek7maAKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4
13rCNfcCk2pMmG57GaIMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATAN
14BgkqhkiG9w0BAQIFAAOBgQBhcOwvP579K+ZoVCGwZ3kIDCCWMYoNer62Jt95LCJp
15STbjl3diYaIy13pUITa6Ask05yXaRDWw0lyAXbOU+Pms7qRgdSoflUkjsUp89LNH
16ciFbfperVKxi513srpvSybIk+4Kt6WcVS7qqpvCXoPawl1cAyAw8CaCCBLpB2veZ
17pA==
18-----END CERTIFICATE-----
diff --git a/src/lib/libssl/src/crypto/bn/asm/x86_64-gcc.c b/src/lib/libssl/src/crypto/bn/asm/x86_64-gcc.c
index b97b394661..450e8e4322 100644
--- a/src/lib/libssl/src/crypto/bn/asm/x86_64-gcc.c
+++ b/src/lib/libssl/src/crypto/bn/asm/x86_64-gcc.c
@@ -142,7 +142,7 @@ void bn_sqr_words(BN_ULONG *r, BN_ULONG *a, int n)
142BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) 142BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d)
143{ BN_ULONG ret,waste; 143{ BN_ULONG ret,waste;
144 144
145 asm ("divq %3" 145 asm ("divq %4"
146 : "=a"(ret),"=d"(waste) 146 : "=a"(ret),"=d"(waste)
147 : "a"(l),"d"(h),"g"(d) 147 : "a"(l),"d"(h),"g"(d)
148 : "cc"); 148 : "cc");
diff --git a/src/lib/libssl/src/crypto/rc5/rc5_locl.h b/src/lib/libssl/src/crypto/rc5/rc5_locl.h
new file mode 100644
index 0000000000..f4ebc23004
--- /dev/null
+++ b/src/lib/libssl/src/crypto/rc5/rc5_locl.h
@@ -0,0 +1,207 @@
1/* crypto/rc5/rc5_locl.h */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58
59#include <stdlib.h>
60
61#undef c2l
62#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
63 l|=((unsigned long)(*((c)++)))<< 8L, \
64 l|=((unsigned long)(*((c)++)))<<16L, \
65 l|=((unsigned long)(*((c)++)))<<24L)
66
67/* NOTE - c is not incremented as per c2l */
68#undef c2ln
69#define c2ln(c,l1,l2,n) { \
70 c+=n; \
71 l1=l2=0; \
72 switch (n) { \
73 case 8: l2 =((unsigned long)(*(--(c))))<<24L; \
74 case 7: l2|=((unsigned long)(*(--(c))))<<16L; \
75 case 6: l2|=((unsigned long)(*(--(c))))<< 8L; \
76 case 5: l2|=((unsigned long)(*(--(c)))); \
77 case 4: l1 =((unsigned long)(*(--(c))))<<24L; \
78 case 3: l1|=((unsigned long)(*(--(c))))<<16L; \
79 case 2: l1|=((unsigned long)(*(--(c))))<< 8L; \
80 case 1: l1|=((unsigned long)(*(--(c)))); \
81 } \
82 }
83
84#undef l2c
85#define l2c(l,c) (*((c)++)=(unsigned char)(((l) )&0xff), \
86 *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
87 *((c)++)=(unsigned char)(((l)>>16L)&0xff), \
88 *((c)++)=(unsigned char)(((l)>>24L)&0xff))
89
90/* NOTE - c is not incremented as per l2c */
91#undef l2cn
92#define l2cn(l1,l2,c,n) { \
93 c+=n; \
94 switch (n) { \
95 case 8: *(--(c))=(unsigned char)(((l2)>>24L)&0xff); \
96 case 7: *(--(c))=(unsigned char)(((l2)>>16L)&0xff); \
97 case 6: *(--(c))=(unsigned char)(((l2)>> 8L)&0xff); \
98 case 5: *(--(c))=(unsigned char)(((l2) )&0xff); \
99 case 4: *(--(c))=(unsigned char)(((l1)>>24L)&0xff); \
100 case 3: *(--(c))=(unsigned char)(((l1)>>16L)&0xff); \
101 case 2: *(--(c))=(unsigned char)(((l1)>> 8L)&0xff); \
102 case 1: *(--(c))=(unsigned char)(((l1) )&0xff); \
103 } \
104 }
105
106/* NOTE - c is not incremented as per n2l */
107#define n2ln(c,l1,l2,n) { \
108 c+=n; \
109 l1=l2=0; \
110 switch (n) { \
111 case 8: l2 =((unsigned long)(*(--(c)))) ; \
112 case 7: l2|=((unsigned long)(*(--(c))))<< 8; \
113 case 6: l2|=((unsigned long)(*(--(c))))<<16; \
114 case 5: l2|=((unsigned long)(*(--(c))))<<24; \
115 case 4: l1 =((unsigned long)(*(--(c)))) ; \
116 case 3: l1|=((unsigned long)(*(--(c))))<< 8; \
117 case 2: l1|=((unsigned long)(*(--(c))))<<16; \
118 case 1: l1|=((unsigned long)(*(--(c))))<<24; \
119 } \
120 }
121
122/* NOTE - c is not incremented as per l2n */
123#define l2nn(l1,l2,c,n) { \
124 c+=n; \
125 switch (n) { \
126 case 8: *(--(c))=(unsigned char)(((l2) )&0xff); \
127 case 7: *(--(c))=(unsigned char)(((l2)>> 8)&0xff); \
128 case 6: *(--(c))=(unsigned char)(((l2)>>16)&0xff); \
129 case 5: *(--(c))=(unsigned char)(((l2)>>24)&0xff); \
130 case 4: *(--(c))=(unsigned char)(((l1) )&0xff); \
131 case 3: *(--(c))=(unsigned char)(((l1)>> 8)&0xff); \
132 case 2: *(--(c))=(unsigned char)(((l1)>>16)&0xff); \
133 case 1: *(--(c))=(unsigned char)(((l1)>>24)&0xff); \
134 } \
135 }
136
137#undef n2l
138#define n2l(c,l) (l =((unsigned long)(*((c)++)))<<24L, \
139 l|=((unsigned long)(*((c)++)))<<16L, \
140 l|=((unsigned long)(*((c)++)))<< 8L, \
141 l|=((unsigned long)(*((c)++))))
142
143#undef l2n
144#define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24L)&0xff), \
145 *((c)++)=(unsigned char)(((l)>>16L)&0xff), \
146 *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \
147 *((c)++)=(unsigned char)(((l) )&0xff))
148
149#if defined(OPENSSL_SYS_WIN32) && defined(_MSC_VER)
150#define ROTATE_l32(a,n) _lrotl(a,n)
151#define ROTATE_r32(a,n) _lrotr(a,n)
152#elif defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC)
153# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__)
154# define ROTATE_l32(a,n) ({ register unsigned int ret; \
155 asm ("roll %%cl,%0" \
156 : "=r"(ret) \
157 : "c"(n),"0"(a) \
158 : "cc"); \
159 ret; \
160 })
161# define ROTATE_r32(a,n) ({ register unsigned int ret; \
162 asm ("rorl %%cl,%0" \
163 : "=r"(ret) \
164 : "c"(n),"0"(a) \
165 : "cc"); \
166 ret; \
167 })
168# endif
169#endif
170#ifndef ROTATE_l32
171#define ROTATE_l32(a,n) (((a)<<(n&0x1f))|(((a)&0xffffffff)>>(32-(n&0x1f))))
172#endif
173#ifndef ROTATE_r32
174#define ROTATE_r32(a,n) (((a)<<(32-(n&0x1f)))|(((a)&0xffffffff)>>(n&0x1f)))
175#endif
176
177#define RC5_32_MASK 0xffffffffL
178
179#define RC5_16_P 0xB7E1
180#define RC5_16_Q 0x9E37
181#define RC5_32_P 0xB7E15163L
182#define RC5_32_Q 0x9E3779B9L
183#define RC5_64_P 0xB7E151628AED2A6BLL
184#define RC5_64_Q 0x9E3779B97F4A7C15LL
185
186#define E_RC5_32(a,b,s,n) \
187 a^=b; \
188 a=ROTATE_l32(a,b); \
189 a+=s[n]; \
190 a&=RC5_32_MASK; \
191 b^=a; \
192 b=ROTATE_l32(b,a); \
193 b+=s[n+1]; \
194 b&=RC5_32_MASK;
195
196#define D_RC5_32(a,b,s,n) \
197 b-=s[n+1]; \
198 b&=RC5_32_MASK; \
199 b=ROTATE_r32(b,a); \
200 b^=a; \
201 a-=s[n]; \
202 a&=RC5_32_MASK; \
203 a=ROTATE_r32(a,b); \
204 a^=b;
205
206
207
diff --git a/src/lib/libssl/src/doc/apps/s_time.pod b/src/lib/libssl/src/doc/apps/s_time.pod
new file mode 100644
index 0000000000..5a38aa2e03
--- /dev/null
+++ b/src/lib/libssl/src/doc/apps/s_time.pod
@@ -0,0 +1,173 @@
1
2=pod
3
4=head1 NAME
5
6s_time - SSL/TLS performance timing program
7
8=head1 SYNOPSIS
9
10B<openssl> B<s_time>
11[B<-connect host:port>]
12[B<-www page>]
13[B<-cert filename>]
14[B<-key filename>]
15[B<-CApath directory>]
16[B<-CAfile filename>]
17[B<-reuse>]
18[B<-new>]
19[B<-verify depth>]
20[B<-nbio>]
21[B<-time seconds>]
22[B<-ssl2>]
23[B<-ssl3>]
24[B<-bugs>]
25[B<-cipher cipherlist>]
26
27=head1 DESCRIPTION
28
29The B<s_client> command implements a generic SSL/TLS client which connects to a
30remote host using SSL/TLS. It can request a page from the server and includes
31the time to transfer the payload data in its timing measurements. It measures
32the number of connections within a given timeframe, the amount of data
33transferred (if any), and calculates the average time spent for one connection.
34
35=head1 OPTIONS
36
37=over 4
38
39=item B<-connect host:port>
40
41This specifies the host and optional port to connect to.
42
43=item B<-www page>
44
45This specifies the page to GET from the server. A value of '/' gets the
46index.htm[l] page. If this parameter is not specified, then B<s_time> will only
47perform the handshake to establish SSL connections but not transfer any
48payload data.
49
50=item B<-cert certname>
51
52The certificate to use, if one is requested by the server. The default is
53not to use a certificate. The file is in PEM format.
54
55=item B<-key keyfile>
56
57The private key to use. If not specified then the certificate file will
58be used. The file is in PEM format.
59
60=item B<-verify depth>
61
62The verify depth to use. This specifies the maximum length of the
63server certificate chain and turns on server certificate verification.
64Currently the verify operation continues after errors so all the problems
65with a certificate chain can be seen. As a side effect the connection
66will never fail due to a server certificate verify failure.
67
68=item B<-CApath directory>
69
70The directory to use for server certificate verification. This directory
71must be in "hash format", see B<verify> for more information. These are
72also used when building the client certificate chain.
73
74=item B<-CAfile file>
75
76A file containing trusted certificates to use during server authentication
77and to use when attempting to build the client certificate chain.
78
79=item B<-new>
80
81performs the timing test using a new session ID for each connection.
82If neither B<-new> nor B<-reuse> are specified, they are both on by default
83and executed in sequence.
84
85=item B<-reuse>
86
87performs the timing test using the same session ID; this can be used as a test
88that session caching is working. If neither B<-new> nor B<-reuse> are
89specified, they are both on by default and executed in sequence.
90
91=item B<-nbio>
92
93turns on non-blocking I/O.
94
95=item B<-ssl2>, B<-ssl3>
96
97these options disable the use of certain SSL or TLS protocols. By default
98the initial handshake uses a method which should be compatible with all
99servers and permit them to use SSL v3, SSL v2 or TLS as appropriate.
100The timing program is not as rich in options to turn protocols on and off as
101the L<s_client(1)|s_client(1)> program and may not connect to all servers.
102
103Unfortunately there are a lot of ancient and broken servers in use which
104cannot handle this technique and will fail to connect. Some servers only
105work if TLS is turned off with the B<-ssl3> option; others
106will only support SSL v2 and may need the B<-ssl2> option.
107
108=item B<-bugs>
109
110there are several known bug in SSL and TLS implementations. Adding this
111option enables various workarounds.
112
113=item B<-cipher cipherlist>
114
115this allows the cipher list sent by the client to be modified. Although
116the server determines which cipher suite is used it should take the first
117supported cipher in the list sent by the client.
118See the L<ciphers(1)|ciphers(1)> command for more information.
119
120=item B<-time length>
121
122specifies how long (in seconds) B<s_time> should establish connections and
123optionally transfer payload data from a server. Server and client performance
124and the link speed determine how many connections B<s_time> can establish.
125
126=back
127
128=head1 NOTES
129
130B<s_client> can be used to measure the performance of an SSL connection.
131To connect to an SSL HTTP server and get the default page the command
132
133 openssl s_time -connect servername:443 -www / -CApath yourdir -CAfile yourfile.pem -cipher commoncipher [-ssl3]
134
135would typically be used (https uses port 443). 'commoncipher' is a cipher to
136which both client and server can agree, see the L<ciphers(1)|ciphers(1)> command
137for details.
138
139If the handshake fails then there are several possible causes, if it is
140nothing obvious like no client certificate then the B<-bugs>, B<-ssl2>,
141B<-ssl3> options can be tried
142in case it is a buggy server. In particular you should play with these
143options B<before> submitting a bug report to an OpenSSL mailing list.
144
145A frequent problem when attempting to get client certificates working
146is that a web client complains it has no certificates or gives an empty
147list to choose from. This is normally because the server is not sending
148the clients certificate authority in its "acceptable CA list" when it
149requests a certificate. By using L<s_client(1)|s_client(1)> the CA list can be
150viewed and checked. However some servers only request client authentication
151after a specific URL is requested. To obtain the list in this case it
152is necessary to use the B<-prexit> option of L<s_client(1)|s_client(1)> and
153send an HTTP request for an appropriate page.
154
155If a certificate is specified on the command line using the B<-cert>
156option it will not be used unless the server specifically requests
157a client certificate. Therefor merely including a client certificate
158on the command line is no guarantee that the certificate works.
159
160=head1 BUGS
161
162Because this program does not have all the options of the
163L<s_client(1)|s_client(1)> program to turn protocols on and off, you may not be
164able to measure the performance of all protocols with all servers.
165
166The B<-verify> option should really exit if the server verification
167fails.
168
169=head1 SEE ALSO
170
171L<s_client(1)|s_client(1)>, L<s_server(1)|s_server(1)>, L<ciphers(1)|ciphers(1)>
172
173=cut
diff --git a/src/lib/libssl/src/doc/crypto/CONF_modules_free.pod b/src/lib/libssl/src/doc/crypto/CONF_modules_free.pod
new file mode 100644
index 0000000000..af8ae6a5c9
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/CONF_modules_free.pod
@@ -0,0 +1,47 @@
1=pod
2
3=head1 NAME
4
5 CONF_modules_free, CONF_modules_load, CONF_modules_unload -
6 OpenSSL configuration cleanup functions
7
8=head1 SYNOPSIS
9
10 #include <openssl/conf.h>
11
12 void CONF_modules_free(void);
13 void CONF_modules_unload(int all);
14 void CONF_modules_finish(void);
15
16=head1 DESCRIPTION
17
18CONF_modules_free() closes down and frees up all memory allocated by all
19configuration modules.
20
21CONF_modules_finish() calls each configuration modules B<finish> handler
22to free up any configuration that module may have performed.
23
24CONF_modules_unload() finishes and unloads configuration modules. If
25B<all> is set to B<0> only modules loaded from DSOs will be unloads. If
26B<all> is B<1> all modules, including builtin modules will be unloaded.
27
28=head1 NOTES
29
30Normally applications will only call CONF_modules_free() at application to
31tidy up any configuration performed.
32
33=head1 RETURN VALUE
34
35None of the functions return a value.
36
37=head1 SEE ALSO
38
39L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>,
40L<CONF_modules_load_file(3), CONF_modules_load_file(3)>
41
42=head1 HISTORY
43
44CONF_modules_free(), CONF_modules_unload(), and CONF_modules_finish()
45first appeared in OpenSSL 0.9.7.
46
47=cut
diff --git a/src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod b/src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod
new file mode 100644
index 0000000000..9965d69bf2
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/CONF_modules_load_file.pod
@@ -0,0 +1,60 @@
1=pod
2
3=head1 NAME
4
5 CONF_modules_load_file, CONF_modules_load - OpenSSL configuration functions
6
7=head1 SYNOPSIS
8
9 #include <openssl/conf.h>
10
11 int CONF_modules_load_file(const char *filename, const char *appname,
12 unsigned long flags);
13 int CONF_modules_load(const CONF *cnf, const char *appname,
14 unsigned long flags);
15
16=head1 DESCRIPTION
17
18The function CONF_modules_load_file() configures OpenSSL using file
19B<filename> and application name B<appname>. If B<filename> is NULL
20the standard OpenSSL configuration file is used. If B<appname> is
21NULL the standard OpenSSL application name B<openssl_conf> is used.
22The behaviour can be cutomized using B<flags>.
23
24CONF_modules_load() is idential to CONF_modules_load_file() except it
25read configuration information from B<cnf>.
26
27=head1 NOTES
28
29The following B<flags> are currently recognized:
30
31B<CONF_MFLAGS_IGNORE_ERRORS> if set errors returned by individual
32configuration modules are ignored. If not set the first module error is
33considered fatal and no further modules are loads.
34
35Normally any modules errors will add error information to the error queue. If
36B<CONF_MFLAGS_SILENT> is set no error information is added.
37
38If B<CONF_MFLAGS_NO_DSO> is set configuration module loading from DSOs is
39disabled.
40
41B<CONF_MFLAGS_IGNORE_MISSING_FILE> if set will make CONF_load_modules_file()
42ignore missing configuration files. Normally a missing configuration file
43return an error.
44
45=head1 RETURN VALUE
46
47These functions return 1 for success and a zero or negative value for
48failure. If module errors are not ignored the return code will reflect the
49return value of the failing module (this will always be zero or negative).
50
51=head1 SEE ALSO
52
53L<conf(5)|conf(5)>, L<OPENSSL_config(3)|OPENSSL_config(3)>,
54L<CONF_free(3), CONF_free(3)>, L<err(3),err(3)>
55
56=head1 HISTORY
57
58CONF_modules_load_file and CONF_modules_load first appeared in OpenSSL 0.9.7.
59
60=cut
diff --git a/src/lib/libssl/src/doc/crypto/OPENSSL_config.pod b/src/lib/libssl/src/doc/crypto/OPENSSL_config.pod
new file mode 100644
index 0000000000..16600620cc
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/OPENSSL_config.pod
@@ -0,0 +1,82 @@
1=pod
2
3=head1 NAME
4
5OPENSSL_config, OPENSSL_no_config - simple OpenSSL configuration functions
6
7=head1 SYNOPSIS
8
9 #include <openssl/conf.h>
10
11 void OPENSSL_config(const char *config_name);
12 void OPENSSL_no_config(void);
13
14=head1 DESCRIPTION
15
16OPENSSL_config() configures OpenSSL using the standard B<openssl.cnf>
17configuration file name using B<config_name>. If B<config_name> is NULL then
18the default name B<openssl_conf> will be used. Any errors are ignored. Further
19calls to OPENSSL_config() will have no effect. The configuration file format
20is documented in the L<conf(5)|conf(5)> manual page.
21
22OPENSSL_no_config() disables configuration. If called before OPENSSL_config()
23no configuration takes place.
24
25=head1 NOTES
26
27It is B<strongly> recommended that B<all> new applications call OPENSSL_config()
28or the more sophisticated functions such as CONF_modules_load() during
29initialization (that is before starting any threads). By doing this
30an application does not need to keep track of all configuration options
31and some new functionality can be supported automatically.
32
33It is also possible to automatically call OPENSSL_config() when an application
34calls OPENSSL_add_all_algorithms() by compiling an application with the
35preprocessor symbol B<OPENSSL_LOAD_CONF> #define'd. In this way configuration
36can be added without source changes.
37
38The environment variable B<OPENSSL_CONFIG> can be set to specify the location
39of the configuration file.
40
41Currently ASN1 OBJECTs and ENGINE configuration can be performed future
42versions of OpenSSL will add new configuration options.
43
44There are several reasons why calling the OpenSSL configuration routines is
45advisable. For example new ENGINE functionality was added to OpenSSL 0.9.7.
46In OpenSSL 0.9.7 control functions can be supported by ENGINEs, this can be
47used (among other things) to load dynamic ENGINEs from shared libraries (DSOs).
48However very few applications currently support the control interface and so
49very few can load and use dynamic ENGINEs. Equally in future more sophisticated
50ENGINEs will require certain control operations to customize them. If an
51application calls OPENSSL_config() it doesn't need to know or care about
52ENGINE control operations because they can be performed by editing a
53configuration file.
54
55Applications should free up configuration at application closedown by calling
56CONF_modules_free().
57
58=head1 RESTRICTIONS
59
60The OPENSSL_config() function is designed to be a very simple "call it and
61forget it" function. As a result its behaviour is somewhat limited. It ignores
62all errors silently and it can only load from the standard configuration file
63location for example.
64
65It is however B<much> better than nothing. Applications which need finer
66control over their configuration functionality should use the configuration
67functions such as CONF_load_modules() directly.
68
69=head1 RETURN VALUES
70
71Neither OPENSSL_config() nor OPENSSL_no_config() return a value.
72
73=head1 SEE ALSO
74
75L<conf(5)|conf(5)>, L<CONF_load_modules_file(3)|CONF_load_modules_file(3)>,
76L<CONF_modules_free(3),CONF_modules_free(3)>
77
78=head1 HISTORY
79
80OPENSSL_config() and OPENSSL_no_config() first appeared in OpenSSL 0.9.7
81
82=cut
diff --git a/src/lib/libssl/src/doc/crypto/OPENSSL_load_builtin_modules.pod b/src/lib/libssl/src/doc/crypto/OPENSSL_load_builtin_modules.pod
new file mode 100644
index 0000000000..f14dfaf005
--- /dev/null
+++ b/src/lib/libssl/src/doc/crypto/OPENSSL_load_builtin_modules.pod
@@ -0,0 +1,51 @@
1=pod
2
3=head1 NAME
4
5OPENSSL_load_builtin_modules - add standard configuration modules
6
7=head1 SYNOPSIS
8
9 #include <openssl/conf.h>
10
11 void OPENSSL_load_builtin_modules(void);
12 void ASN1_add_oid_module(void);
13 ENGINE_add_conf_module();
14
15=head1 DESCRIPTION
16
17The function OPENSSL_load_builtin_modules() adds all the standard OpenSSL
18configuration modules to the internal list. They can then be used by the
19OpenSSL configuration code.
20
21ASN1_add_oid_module() adds just the ASN1 OBJECT module.
22
23ENGINE_add_conf_module() adds just the ENGINE configuration module.
24
25=head1 NOTES
26
27If the simple configuration function OPENSSL_config() is called then
28OPENSSL_load_builtin_modules() is called automatically.
29
30Applications which use the configuration functions directly will need to
31call OPENSSL_load_builtin_modules() themselves I<before> any other
32configuration code.
33
34Applications should call OPENSSL_load_builtin_modules() to load all
35configuration modules instead of adding modules selectively: otherwise
36functionality may be missing from the application if an when new
37modules are added.
38
39=head1 RETURN VALUE
40
41None of the functions return a value.
42
43=head1 SEE ALSO
44
45L<conf(3)|conf(3)>, L<OPENSSL_config(3)|OPENSSL_config(3)>
46
47=head1 HISTORY
48
49These functions first appeared in OpenSSL 0.9.7.
50
51=cut
diff --git a/src/lib/libssl/src/doc/crypto/d2i_DSAPublicKey.pod b/src/lib/libssl/src/doc/crypto/d2i_DSAPublicKey.pod
index 6ebd30427b..22c1b50f22 100644
--- a/src/lib/libssl/src/doc/crypto/d2i_DSAPublicKey.pod
+++ b/src/lib/libssl/src/doc/crypto/d2i_DSAPublicKey.pod
@@ -9,6 +9,7 @@ and parsing functions.
9=head1 SYNOPSIS 9=head1 SYNOPSIS
10 10
11 #include <openssl/dsa.h> 11 #include <openssl/dsa.h>
12 #include <openssl/x509.h>
12 13
13 DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length); 14 DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
14 15
@@ -35,8 +36,8 @@ and parsing functions.
35d2i_DSAPublicKey() and i2d_DSAPublicKey() decode and encode the DSA public key 36d2i_DSAPublicKey() and i2d_DSAPublicKey() decode and encode the DSA public key
36components structure. 37components structure.
37 38
38d2i_DSA_PUKEY() and i2d_DSA_PUKEY() decode and encode an DSA public key using a 39d2i_DSA_PUBKEY() and i2d_DSA_PUBKEY() decode and encode an DSA public key using
39SubjectPublicKeyInfo (certificate public key) structure. 40a SubjectPublicKeyInfo (certificate public key) structure.
40 41
41d2i_DSAPrivateKey(), i2d_DSAPrivateKey() decode and encode the DSA private key 42d2i_DSAPrivateKey(), i2d_DSAPrivateKey() decode and encode the DSA private key
42components. 43components.
diff --git a/src/lib/libssl/src/os2/backwardify.pl b/src/lib/libssl/src/os2/backwardify.pl
new file mode 100644
index 0000000000..272423c8fa
--- /dev/null
+++ b/src/lib/libssl/src/os2/backwardify.pl
@@ -0,0 +1,32 @@
1#!/usr/bin/perl -w
2use strict;
3
4# Use as $0
5# Use as $0 -noname
6
7my $did_library;
8my $did_description;
9my $do_exports;
10my @imports;
11my $noname = (@ARGV and $ARGV[0] eq '-noname' and shift);
12while (<>) {
13 unless ($did_library) {
14 s/\b(cryptssl)\b/crypto/ and $did_library = $1 if /^LIBRARY\s+cryptssl\b/;
15 s/\b(open_ssl)\b/ssl/ and $did_library = $1 if /^LIBRARY\s+open_ssl\b/;
16 }
17 unless ($did_description) {
18 s&^(DESCRIPTION\s+(['"])).*&${1}\@#www.openssl.org/:#\@forwarder DLL for pre-0.9.7c+ OpenSSL to the new dll naming scheme$2& and $did_description++;
19 }
20 if ($do_exports) {{
21 last unless /\S/;
22 warn, last unless /^ \s* ( \w+ ) \s+ \@(\d+)\s*$/x;
23 push @imports, [$1, $2];
24 s/$/ NONAME/ if $noname;
25 }}
26 $do_exports++ if not $do_exports and /^EXPORTS/;
27 print $_;
28}
29print "IMPORTS\n";
30for my $imp (@imports) {
31 print "\t$imp->[0]=$did_library.$imp->[1]\n";
32}
diff --git a/src/lib/libssl/src/util/extract-names.pl b/src/lib/libssl/src/util/extract-names.pl
index 9f2ad5ef16..744a8e2324 100644
--- a/src/lib/libssl/src/util/extract-names.pl
+++ b/src/lib/libssl/src/util/extract-names.pl
@@ -10,6 +10,8 @@ while(<STDIN>) {
10 if (/ - /) { 10 if (/ - /) {
11 s/ - .*//; 11 s/ - .*//;
12 s/,[ \t]+/,/g; 12 s/,[ \t]+/,/g;
13 s/^[ \t]+//g;
14 s/[ \t]+$//g;
13 push @words, split ','; 15 push @words, split ',';
14 } 16 }
15 } 17 }