diff options
author | reyk <> | 2014-04-14 10:03:00 +0000 |
---|---|---|
committer | reyk <> | 2014-04-14 10:03:00 +0000 |
commit | 0f3015e1c64e2b9ba3774397257f15287f9ff442 (patch) | |
tree | 38524d165b2b28707da7b3eb2a1ee872a2560b6b /src | |
parent | 93d43446ef3a3bb673548d2cb589dd623ddc672b (diff) | |
download | openbsd-0f3015e1c64e2b9ba3774397257f15287f9ff442.tar.gz openbsd-0f3015e1c64e2b9ba3774397257f15287f9ff442.tar.bz2 openbsd-0f3015e1c64e2b9ba3774397257f15287f9ff442.zip |
Remove the nuron engine. The static engine is not standalone and the
FPGA-based device is long obsolete.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/doc/engine.pod | 1 | ||||
-rw-r--r-- | src/lib/libcrypto/engine/eng_all.c | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/engine/engine.h | 1 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/engine/eng_all.c | 3 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/engine/engine.h | 1 | ||||
-rw-r--r-- | src/lib/libssl/src/doc/crypto/engine.pod | 1 | ||||
-rw-r--r-- | src/lib/libssl/src/engines/Makefile | 20 | ||||
-rw-r--r-- | src/lib/libssl/src/engines/e_nuron.c | 434 | ||||
-rw-r--r-- | src/lib/libssl/src/engines/e_nuron.ec | 1 | ||||
-rw-r--r-- | src/lib/libssl/src/engines/e_nuron_err.c | 146 | ||||
-rw-r--r-- | src/lib/libssl/src/engines/e_nuron_err.h | 90 |
11 files changed, 1 insertions, 700 deletions
diff --git a/src/lib/libcrypto/doc/engine.pod b/src/lib/libcrypto/doc/engine.pod index 4b4d76f3e4..200e687e90 100644 --- a/src/lib/libcrypto/doc/engine.pod +++ b/src/lib/libcrypto/doc/engine.pod | |||
@@ -25,7 +25,6 @@ engine - ENGINE cryptographic module support | |||
25 | void ENGINE_load_dynamic(void); | 25 | void ENGINE_load_dynamic(void); |
26 | #ifndef OPENSSL_NO_STATIC_ENGINE | 26 | #ifndef OPENSSL_NO_STATIC_ENGINE |
27 | void ENGINE_load_gmp(void); | 27 | void ENGINE_load_gmp(void); |
28 | void ENGINE_load_nuron(void); | ||
29 | #endif | 28 | #endif |
30 | void ENGINE_load_cryptodev(void); | 29 | void ENGINE_load_cryptodev(void); |
31 | void ENGINE_load_builtin_engines(void); | 30 | void ENGINE_load_builtin_engines(void); |
diff --git a/src/lib/libcrypto/engine/eng_all.c b/src/lib/libcrypto/engine/eng_all.c index c9210fb514..f3c4cd9a1c 100644 --- a/src/lib/libcrypto/engine/eng_all.c +++ b/src/lib/libcrypto/engine/eng_all.c | |||
@@ -82,9 +82,6 @@ void ENGINE_load_builtin_engines(void) | |||
82 | ENGINE_load_dynamic(); | 82 | ENGINE_load_dynamic(); |
83 | #ifndef OPENSSL_NO_STATIC_ENGINE | 83 | #ifndef OPENSSL_NO_STATIC_ENGINE |
84 | #ifndef OPENSSL_NO_HW | 84 | #ifndef OPENSSL_NO_HW |
85 | #ifndef OPENSSL_NO_HW_NURON | ||
86 | ENGINE_load_nuron(); | ||
87 | #endif | ||
88 | #ifndef OPENSSL_NO_HW_PADLOCK | 85 | #ifndef OPENSSL_NO_HW_PADLOCK |
89 | ENGINE_load_padlock(); | 86 | ENGINE_load_padlock(); |
90 | #endif | 87 | #endif |
diff --git a/src/lib/libcrypto/engine/engine.h b/src/lib/libcrypto/engine/engine.h index a2b7e83a66..51a18f3ee2 100644 --- a/src/lib/libcrypto/engine/engine.h +++ b/src/lib/libcrypto/engine/engine.h | |||
@@ -316,7 +316,6 @@ ENGINE *ENGINE_by_id(const char *id); | |||
316 | void ENGINE_load_openssl(void); | 316 | void ENGINE_load_openssl(void); |
317 | void ENGINE_load_dynamic(void); | 317 | void ENGINE_load_dynamic(void); |
318 | #ifndef OPENSSL_NO_STATIC_ENGINE | 318 | #ifndef OPENSSL_NO_STATIC_ENGINE |
319 | void ENGINE_load_nuron(void); | ||
320 | void ENGINE_load_padlock(void); | 319 | void ENGINE_load_padlock(void); |
321 | void ENGINE_load_capi(void); | 320 | void ENGINE_load_capi(void); |
322 | #ifndef OPENSSL_NO_GMP | 321 | #ifndef OPENSSL_NO_GMP |
diff --git a/src/lib/libssl/src/crypto/engine/eng_all.c b/src/lib/libssl/src/crypto/engine/eng_all.c index c9210fb514..f3c4cd9a1c 100644 --- a/src/lib/libssl/src/crypto/engine/eng_all.c +++ b/src/lib/libssl/src/crypto/engine/eng_all.c | |||
@@ -82,9 +82,6 @@ void ENGINE_load_builtin_engines(void) | |||
82 | ENGINE_load_dynamic(); | 82 | ENGINE_load_dynamic(); |
83 | #ifndef OPENSSL_NO_STATIC_ENGINE | 83 | #ifndef OPENSSL_NO_STATIC_ENGINE |
84 | #ifndef OPENSSL_NO_HW | 84 | #ifndef OPENSSL_NO_HW |
85 | #ifndef OPENSSL_NO_HW_NURON | ||
86 | ENGINE_load_nuron(); | ||
87 | #endif | ||
88 | #ifndef OPENSSL_NO_HW_PADLOCK | 85 | #ifndef OPENSSL_NO_HW_PADLOCK |
89 | ENGINE_load_padlock(); | 86 | ENGINE_load_padlock(); |
90 | #endif | 87 | #endif |
diff --git a/src/lib/libssl/src/crypto/engine/engine.h b/src/lib/libssl/src/crypto/engine/engine.h index a2b7e83a66..51a18f3ee2 100644 --- a/src/lib/libssl/src/crypto/engine/engine.h +++ b/src/lib/libssl/src/crypto/engine/engine.h | |||
@@ -316,7 +316,6 @@ ENGINE *ENGINE_by_id(const char *id); | |||
316 | void ENGINE_load_openssl(void); | 316 | void ENGINE_load_openssl(void); |
317 | void ENGINE_load_dynamic(void); | 317 | void ENGINE_load_dynamic(void); |
318 | #ifndef OPENSSL_NO_STATIC_ENGINE | 318 | #ifndef OPENSSL_NO_STATIC_ENGINE |
319 | void ENGINE_load_nuron(void); | ||
320 | void ENGINE_load_padlock(void); | 319 | void ENGINE_load_padlock(void); |
321 | void ENGINE_load_capi(void); | 320 | void ENGINE_load_capi(void); |
322 | #ifndef OPENSSL_NO_GMP | 321 | #ifndef OPENSSL_NO_GMP |
diff --git a/src/lib/libssl/src/doc/crypto/engine.pod b/src/lib/libssl/src/doc/crypto/engine.pod index 4b4d76f3e4..200e687e90 100644 --- a/src/lib/libssl/src/doc/crypto/engine.pod +++ b/src/lib/libssl/src/doc/crypto/engine.pod | |||
@@ -25,7 +25,6 @@ engine - ENGINE cryptographic module support | |||
25 | void ENGINE_load_dynamic(void); | 25 | void ENGINE_load_dynamic(void); |
26 | #ifndef OPENSSL_NO_STATIC_ENGINE | 26 | #ifndef OPENSSL_NO_STATIC_ENGINE |
27 | void ENGINE_load_gmp(void); | 27 | void ENGINE_load_gmp(void); |
28 | void ENGINE_load_nuron(void); | ||
29 | #endif | 28 | #endif |
30 | void ENGINE_load_cryptodev(void); | 29 | void ENGINE_load_cryptodev(void); |
31 | void ENGINE_load_builtin_engines(void); | 30 | void ENGINE_load_builtin_engines(void); |
diff --git a/src/lib/libssl/src/engines/Makefile b/src/lib/libssl/src/engines/Makefile index 4127be1d90..9e81c6c7e2 100644 --- a/src/lib/libssl/src/engines/Makefile +++ b/src/lib/libssl/src/engines/Makefile | |||
@@ -26,14 +26,12 @@ TEST= | |||
26 | APPS= | 26 | APPS= |
27 | 27 | ||
28 | LIB=$(TOP)/libcrypto.a | 28 | LIB=$(TOP)/libcrypto.a |
29 | LIBNAMES= gmp nuron padlock capi | 29 | LIBNAMES= gmp padlock capi |
30 | 30 | ||
31 | LIBSRC= e_gmp.c \ | 31 | LIBSRC= e_gmp.c \ |
32 | e_nuron.c \ | ||
33 | e_padlock.c \ | 32 | e_padlock.c \ |
34 | e_capi.c | 33 | e_capi.c |
35 | LIBOBJ= e_gmp.o \ | 34 | LIBOBJ= e_gmp.o \ |
36 | e_nuron.o \ | ||
37 | e_padlock.o \ | 35 | e_padlock.o \ |
38 | e_capi.o | 36 | e_capi.o |
39 | 37 | ||
@@ -41,7 +39,6 @@ SRC= $(LIBSRC) | |||
41 | 39 | ||
42 | EXHEADER= | 40 | EXHEADER= |
43 | HEADER= e_gmp_err.c e_gmp_err.h \ | 41 | HEADER= e_gmp_err.c e_gmp_err.h \ |
44 | e_nuron_err.c e_nuron_err.h \ | ||
45 | e_capi_err.c e_capi_err.h | 42 | e_capi_err.c e_capi_err.h |
46 | 43 | ||
47 | ALL= $(GENERAL) $(SRC) $(HEADER) | 44 | ALL= $(GENERAL) $(SRC) $(HEADER) |
@@ -168,21 +165,6 @@ e_gmp.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | |||
168 | e_gmp.o: ../include/openssl/sha.h ../include/openssl/stack.h | 165 | e_gmp.o: ../include/openssl/sha.h ../include/openssl/stack.h |
169 | e_gmp.o: ../include/openssl/symhacks.h ../include/openssl/x509.h | 166 | e_gmp.o: ../include/openssl/symhacks.h ../include/openssl/x509.h |
170 | e_gmp.o: ../include/openssl/x509_vfy.h e_gmp.c | 167 | e_gmp.o: ../include/openssl/x509_vfy.h e_gmp.c |
171 | e_nuron.o: ../include/openssl/asn1.h ../include/openssl/bio.h | ||
172 | e_nuron.o: ../include/openssl/bn.h ../include/openssl/buffer.h | ||
173 | e_nuron.o: ../include/openssl/crypto.h ../include/openssl/dh.h | ||
174 | e_nuron.o: ../include/openssl/dsa.h ../include/openssl/dso.h | ||
175 | e_nuron.o: ../include/openssl/e_os2.h ../include/openssl/ec.h | ||
176 | e_nuron.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h | ||
177 | e_nuron.o: ../include/openssl/engine.h ../include/openssl/err.h | ||
178 | e_nuron.o: ../include/openssl/evp.h ../include/openssl/lhash.h | ||
179 | e_nuron.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h | ||
180 | e_nuron.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h | ||
181 | e_nuron.o: ../include/openssl/ossl_typ.h ../include/openssl/pkcs7.h | ||
182 | e_nuron.o: ../include/openssl/rsa.h ../include/openssl/safestack.h | ||
183 | e_nuron.o: ../include/openssl/sha.h ../include/openssl/stack.h | ||
184 | e_nuron.o: ../include/openssl/symhacks.h ../include/openssl/x509.h | ||
185 | e_nuron.o: ../include/openssl/x509_vfy.h e_nuron.c e_nuron_err.c e_nuron_err.h | ||
186 | e_padlock.o: ../include/openssl/aes.h ../include/openssl/asn1.h | 168 | e_padlock.o: ../include/openssl/aes.h ../include/openssl/asn1.h |
187 | e_padlock.o: ../include/openssl/bio.h ../include/openssl/buffer.h | 169 | e_padlock.o: ../include/openssl/bio.h ../include/openssl/buffer.h |
188 | e_padlock.o: ../include/openssl/crypto.h ../include/openssl/dso.h | 170 | e_padlock.o: ../include/openssl/crypto.h ../include/openssl/dso.h |
diff --git a/src/lib/libssl/src/engines/e_nuron.c b/src/lib/libssl/src/engines/e_nuron.c deleted file mode 100644 index 4c2537cbc3..0000000000 --- a/src/lib/libssl/src/engines/e_nuron.c +++ /dev/null | |||
@@ -1,434 +0,0 @@ | |||
1 | /* crypto/engine/hw_nuron.c */ | ||
2 | /* Written by Ben Laurie for the OpenSSL Project, leaning heavily on Geoff | ||
3 | * Thorpe's Atalla implementation. | ||
4 | */ | ||
5 | /* ==================================================================== | ||
6 | * Copyright (c) 2000-2001 The OpenSSL Project. All rights reserved. | ||
7 | * | ||
8 | * Redistribution and use in source and binary forms, with or without | ||
9 | * modification, are permitted provided that the following conditions | ||
10 | * are met: | ||
11 | * | ||
12 | * 1. Redistributions of source code must retain the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer. | ||
14 | * | ||
15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in | ||
17 | * the documentation and/or other materials provided with the | ||
18 | * distribution. | ||
19 | * | ||
20 | * 3. All advertising materials mentioning features or use of this | ||
21 | * software must display the following acknowledgment: | ||
22 | * "This product includes software developed by the OpenSSL Project | ||
23 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
24 | * | ||
25 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
26 | * endorse or promote products derived from this software without | ||
27 | * prior written permission. For written permission, please contact | ||
28 | * licensing@OpenSSL.org. | ||
29 | * | ||
30 | * 5. Products derived from this software may not be called "OpenSSL" | ||
31 | * nor may "OpenSSL" appear in their names without prior written | ||
32 | * permission of the OpenSSL Project. | ||
33 | * | ||
34 | * 6. Redistributions of any form whatsoever must retain the following | ||
35 | * acknowledgment: | ||
36 | * "This product includes software developed by the OpenSSL Project | ||
37 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
38 | * | ||
39 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
40 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
41 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
42 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
43 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
44 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
45 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
46 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
47 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
48 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
49 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
50 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
51 | * ==================================================================== | ||
52 | * | ||
53 | * This product includes cryptographic software written by Eric Young | ||
54 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
55 | * Hudson (tjh@cryptsoft.com). | ||
56 | * | ||
57 | */ | ||
58 | |||
59 | #include <stdio.h> | ||
60 | #include <string.h> | ||
61 | #include <openssl/crypto.h> | ||
62 | #include <openssl/buffer.h> | ||
63 | #include <openssl/dso.h> | ||
64 | #include <openssl/engine.h> | ||
65 | #ifndef OPENSSL_NO_RSA | ||
66 | #include <openssl/rsa.h> | ||
67 | #endif | ||
68 | #ifndef OPENSSL_NO_DSA | ||
69 | #include <openssl/dsa.h> | ||
70 | #endif | ||
71 | #ifndef OPENSSL_NO_DH | ||
72 | #include <openssl/dh.h> | ||
73 | #endif | ||
74 | #include <openssl/bn.h> | ||
75 | |||
76 | #ifndef OPENSSL_NO_HW | ||
77 | #ifndef OPENSSL_NO_HW_NURON | ||
78 | |||
79 | #define NURON_LIB_NAME "nuron engine" | ||
80 | #include "e_nuron_err.c" | ||
81 | |||
82 | static const char *NURON_LIBNAME = NULL; | ||
83 | static const char *get_NURON_LIBNAME(void) | ||
84 | { | ||
85 | if(NURON_LIBNAME) | ||
86 | return NURON_LIBNAME; | ||
87 | return "nuronssl"; | ||
88 | } | ||
89 | static void free_NURON_LIBNAME(void) | ||
90 | { | ||
91 | if(NURON_LIBNAME) | ||
92 | OPENSSL_free((void*)NURON_LIBNAME); | ||
93 | NURON_LIBNAME = NULL; | ||
94 | } | ||
95 | static long set_NURON_LIBNAME(const char *name) | ||
96 | { | ||
97 | free_NURON_LIBNAME(); | ||
98 | return (((NURON_LIBNAME = BUF_strdup(name)) != NULL) ? 1 : 0); | ||
99 | } | ||
100 | static const char *NURON_F1 = "nuron_mod_exp"; | ||
101 | |||
102 | /* The definitions for control commands specific to this engine */ | ||
103 | #define NURON_CMD_SO_PATH ENGINE_CMD_BASE | ||
104 | static const ENGINE_CMD_DEFN nuron_cmd_defns[] = { | ||
105 | {NURON_CMD_SO_PATH, | ||
106 | "SO_PATH", | ||
107 | "Specifies the path to the 'nuronssl' shared library", | ||
108 | ENGINE_CMD_FLAG_STRING}, | ||
109 | {0, NULL, NULL, 0} | ||
110 | }; | ||
111 | |||
112 | typedef int tfnModExp(BIGNUM *r,const BIGNUM *a,const BIGNUM *p,const BIGNUM *m); | ||
113 | static tfnModExp *pfnModExp = NULL; | ||
114 | |||
115 | static DSO *pvDSOHandle = NULL; | ||
116 | |||
117 | static int nuron_destroy(ENGINE *e) | ||
118 | { | ||
119 | free_NURON_LIBNAME(); | ||
120 | ERR_unload_NURON_strings(); | ||
121 | return 1; | ||
122 | } | ||
123 | |||
124 | static int nuron_init(ENGINE *e) | ||
125 | { | ||
126 | if(pvDSOHandle != NULL) | ||
127 | { | ||
128 | NURONerr(NURON_F_NURON_INIT,NURON_R_ALREADY_LOADED); | ||
129 | return 0; | ||
130 | } | ||
131 | |||
132 | pvDSOHandle = DSO_load(NULL, get_NURON_LIBNAME(), NULL, | ||
133 | DSO_FLAG_NAME_TRANSLATION_EXT_ONLY); | ||
134 | if(!pvDSOHandle) | ||
135 | { | ||
136 | NURONerr(NURON_F_NURON_INIT,NURON_R_DSO_NOT_FOUND); | ||
137 | return 0; | ||
138 | } | ||
139 | |||
140 | pfnModExp = (tfnModExp *)DSO_bind_func(pvDSOHandle, NURON_F1); | ||
141 | if(!pfnModExp) | ||
142 | { | ||
143 | NURONerr(NURON_F_NURON_INIT,NURON_R_DSO_FUNCTION_NOT_FOUND); | ||
144 | return 0; | ||
145 | } | ||
146 | |||
147 | return 1; | ||
148 | } | ||
149 | |||
150 | static int nuron_finish(ENGINE *e) | ||
151 | { | ||
152 | free_NURON_LIBNAME(); | ||
153 | if(pvDSOHandle == NULL) | ||
154 | { | ||
155 | NURONerr(NURON_F_NURON_FINISH,NURON_R_NOT_LOADED); | ||
156 | return 0; | ||
157 | } | ||
158 | if(!DSO_free(pvDSOHandle)) | ||
159 | { | ||
160 | NURONerr(NURON_F_NURON_FINISH,NURON_R_DSO_FAILURE); | ||
161 | return 0; | ||
162 | } | ||
163 | pvDSOHandle=NULL; | ||
164 | pfnModExp=NULL; | ||
165 | return 1; | ||
166 | } | ||
167 | |||
168 | static int nuron_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void)) | ||
169 | { | ||
170 | int initialised = ((pvDSOHandle == NULL) ? 0 : 1); | ||
171 | switch(cmd) | ||
172 | { | ||
173 | case NURON_CMD_SO_PATH: | ||
174 | if(p == NULL) | ||
175 | { | ||
176 | NURONerr(NURON_F_NURON_CTRL,ERR_R_PASSED_NULL_PARAMETER); | ||
177 | return 0; | ||
178 | } | ||
179 | if(initialised) | ||
180 | { | ||
181 | NURONerr(NURON_F_NURON_CTRL,NURON_R_ALREADY_LOADED); | ||
182 | return 0; | ||
183 | } | ||
184 | return set_NURON_LIBNAME((const char *)p); | ||
185 | default: | ||
186 | break; | ||
187 | } | ||
188 | NURONerr(NURON_F_NURON_CTRL,NURON_R_CTRL_COMMAND_NOT_IMPLEMENTED); | ||
189 | return 0; | ||
190 | } | ||
191 | |||
192 | static int nuron_mod_exp(BIGNUM *r,const BIGNUM *a,const BIGNUM *p, | ||
193 | const BIGNUM *m,BN_CTX *ctx) | ||
194 | { | ||
195 | if(!pvDSOHandle) | ||
196 | { | ||
197 | NURONerr(NURON_F_NURON_MOD_EXP,NURON_R_NOT_LOADED); | ||
198 | return 0; | ||
199 | } | ||
200 | return pfnModExp(r,a,p,m); | ||
201 | } | ||
202 | |||
203 | #ifndef OPENSSL_NO_RSA | ||
204 | static int nuron_rsa_mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx) | ||
205 | { | ||
206 | return nuron_mod_exp(r0,I,rsa->d,rsa->n,ctx); | ||
207 | } | ||
208 | #endif | ||
209 | |||
210 | #ifndef OPENSSL_NO_DSA | ||
211 | /* This code was liberated and adapted from the commented-out code in | ||
212 | * dsa_ossl.c. Because of the unoptimised form of the Atalla acceleration | ||
213 | * (it doesn't have a CRT form for RSA), this function means that an | ||
214 | * Atalla system running with a DSA server certificate can handshake | ||
215 | * around 5 or 6 times faster/more than an equivalent system running with | ||
216 | * RSA. Just check out the "signs" statistics from the RSA and DSA parts | ||
217 | * of "openssl speed -engine atalla dsa1024 rsa1024". */ | ||
218 | static int nuron_dsa_mod_exp(DSA *dsa, BIGNUM *rr, BIGNUM *a1, | ||
219 | BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, BIGNUM *m, | ||
220 | BN_CTX *ctx, BN_MONT_CTX *in_mont) | ||
221 | { | ||
222 | BIGNUM t; | ||
223 | int to_return = 0; | ||
224 | |||
225 | BN_init(&t); | ||
226 | /* let rr = a1 ^ p1 mod m */ | ||
227 | if (!nuron_mod_exp(rr,a1,p1,m,ctx)) | ||
228 | goto end; | ||
229 | /* let t = a2 ^ p2 mod m */ | ||
230 | if (!nuron_mod_exp(&t,a2,p2,m,ctx)) | ||
231 | goto end; | ||
232 | /* let rr = rr * t mod m */ | ||
233 | if (!BN_mod_mul(rr,rr,&t,m,ctx)) | ||
234 | goto end; | ||
235 | to_return = 1; | ||
236 | end: | ||
237 | BN_free(&t); | ||
238 | return to_return; | ||
239 | } | ||
240 | |||
241 | |||
242 | static int nuron_mod_exp_dsa(DSA *dsa, BIGNUM *r, BIGNUM *a, | ||
243 | const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, | ||
244 | BN_MONT_CTX *m_ctx) | ||
245 | { | ||
246 | return nuron_mod_exp(r, a, p, m, ctx); | ||
247 | } | ||
248 | #endif | ||
249 | |||
250 | /* This function is aliased to mod_exp (with the mont stuff dropped). */ | ||
251 | #ifndef OPENSSL_NO_RSA | ||
252 | static int nuron_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, | ||
253 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx) | ||
254 | { | ||
255 | return nuron_mod_exp(r, a, p, m, ctx); | ||
256 | } | ||
257 | #endif | ||
258 | |||
259 | #ifndef OPENSSL_NO_DH | ||
260 | /* This function is aliased to mod_exp (with the dh and mont dropped). */ | ||
261 | static int nuron_mod_exp_dh(const DH *dh, BIGNUM *r, | ||
262 | const BIGNUM *a, const BIGNUM *p, | ||
263 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx) | ||
264 | { | ||
265 | return nuron_mod_exp(r, a, p, m, ctx); | ||
266 | } | ||
267 | #endif | ||
268 | |||
269 | #ifndef OPENSSL_NO_RSA | ||
270 | static RSA_METHOD nuron_rsa = | ||
271 | { | ||
272 | "Nuron RSA method", | ||
273 | NULL, | ||
274 | NULL, | ||
275 | NULL, | ||
276 | NULL, | ||
277 | nuron_rsa_mod_exp, | ||
278 | nuron_mod_exp_mont, | ||
279 | NULL, | ||
280 | NULL, | ||
281 | 0, | ||
282 | NULL, | ||
283 | NULL, | ||
284 | NULL, | ||
285 | NULL | ||
286 | }; | ||
287 | #endif | ||
288 | |||
289 | #ifndef OPENSSL_NO_DSA | ||
290 | static DSA_METHOD nuron_dsa = | ||
291 | { | ||
292 | "Nuron DSA method", | ||
293 | NULL, /* dsa_do_sign */ | ||
294 | NULL, /* dsa_sign_setup */ | ||
295 | NULL, /* dsa_do_verify */ | ||
296 | nuron_dsa_mod_exp, /* dsa_mod_exp */ | ||
297 | nuron_mod_exp_dsa, /* bn_mod_exp */ | ||
298 | NULL, /* init */ | ||
299 | NULL, /* finish */ | ||
300 | 0, /* flags */ | ||
301 | NULL, /* app_data */ | ||
302 | NULL, /* dsa_paramgen */ | ||
303 | NULL /* dsa_keygen */ | ||
304 | }; | ||
305 | #endif | ||
306 | |||
307 | #ifndef OPENSSL_NO_DH | ||
308 | static DH_METHOD nuron_dh = | ||
309 | { | ||
310 | "Nuron DH method", | ||
311 | NULL, | ||
312 | NULL, | ||
313 | nuron_mod_exp_dh, | ||
314 | NULL, | ||
315 | NULL, | ||
316 | 0, | ||
317 | NULL, | ||
318 | NULL | ||
319 | }; | ||
320 | #endif | ||
321 | |||
322 | /* Constants used when creating the ENGINE */ | ||
323 | static const char *engine_nuron_id = "nuron"; | ||
324 | static const char *engine_nuron_name = "Nuron hardware engine support"; | ||
325 | |||
326 | /* This internal function is used by ENGINE_nuron() and possibly by the | ||
327 | * "dynamic" ENGINE support too */ | ||
328 | static int bind_helper(ENGINE *e) | ||
329 | { | ||
330 | #ifndef OPENSSL_NO_RSA | ||
331 | const RSA_METHOD *meth1; | ||
332 | #endif | ||
333 | #ifndef OPENSSL_NO_DSA | ||
334 | const DSA_METHOD *meth2; | ||
335 | #endif | ||
336 | #ifndef OPENSSL_NO_DH | ||
337 | const DH_METHOD *meth3; | ||
338 | #endif | ||
339 | if(!ENGINE_set_id(e, engine_nuron_id) || | ||
340 | !ENGINE_set_name(e, engine_nuron_name) || | ||
341 | #ifndef OPENSSL_NO_RSA | ||
342 | !ENGINE_set_RSA(e, &nuron_rsa) || | ||
343 | #endif | ||
344 | #ifndef OPENSSL_NO_DSA | ||
345 | !ENGINE_set_DSA(e, &nuron_dsa) || | ||
346 | #endif | ||
347 | #ifndef OPENSSL_NO_DH | ||
348 | !ENGINE_set_DH(e, &nuron_dh) || | ||
349 | #endif | ||
350 | !ENGINE_set_destroy_function(e, nuron_destroy) || | ||
351 | !ENGINE_set_init_function(e, nuron_init) || | ||
352 | !ENGINE_set_finish_function(e, nuron_finish) || | ||
353 | !ENGINE_set_ctrl_function(e, nuron_ctrl) || | ||
354 | !ENGINE_set_cmd_defns(e, nuron_cmd_defns)) | ||
355 | return 0; | ||
356 | |||
357 | #ifndef OPENSSL_NO_RSA | ||
358 | /* We know that the "PKCS1_SSLeay()" functions hook properly | ||
359 | * to the nuron-specific mod_exp and mod_exp_crt so we use | ||
360 | * those functions. NB: We don't use ENGINE_openssl() or | ||
361 | * anything "more generic" because something like the RSAref | ||
362 | * code may not hook properly, and if you own one of these | ||
363 | * cards then you have the right to do RSA operations on it | ||
364 | * anyway! */ | ||
365 | meth1=RSA_PKCS1_SSLeay(); | ||
366 | nuron_rsa.rsa_pub_enc=meth1->rsa_pub_enc; | ||
367 | nuron_rsa.rsa_pub_dec=meth1->rsa_pub_dec; | ||
368 | nuron_rsa.rsa_priv_enc=meth1->rsa_priv_enc; | ||
369 | nuron_rsa.rsa_priv_dec=meth1->rsa_priv_dec; | ||
370 | #endif | ||
371 | |||
372 | #ifndef OPENSSL_NO_DSA | ||
373 | /* Use the DSA_OpenSSL() method and just hook the mod_exp-ish | ||
374 | * bits. */ | ||
375 | meth2=DSA_OpenSSL(); | ||
376 | nuron_dsa.dsa_do_sign=meth2->dsa_do_sign; | ||
377 | nuron_dsa.dsa_sign_setup=meth2->dsa_sign_setup; | ||
378 | nuron_dsa.dsa_do_verify=meth2->dsa_do_verify; | ||
379 | #endif | ||
380 | |||
381 | #ifndef OPENSSL_NO_DH | ||
382 | /* Much the same for Diffie-Hellman */ | ||
383 | meth3=DH_OpenSSL(); | ||
384 | nuron_dh.generate_key=meth3->generate_key; | ||
385 | nuron_dh.compute_key=meth3->compute_key; | ||
386 | #endif | ||
387 | |||
388 | /* Ensure the nuron error handling is set up */ | ||
389 | ERR_load_NURON_strings(); | ||
390 | return 1; | ||
391 | } | ||
392 | |||
393 | #ifdef OPENSSL_NO_DYNAMIC_ENGINE | ||
394 | static ENGINE *engine_nuron(void) | ||
395 | { | ||
396 | ENGINE *ret = ENGINE_new(); | ||
397 | if(!ret) | ||
398 | return NULL; | ||
399 | if(!bind_helper(ret)) | ||
400 | { | ||
401 | ENGINE_free(ret); | ||
402 | return NULL; | ||
403 | } | ||
404 | return ret; | ||
405 | } | ||
406 | |||
407 | void ENGINE_load_nuron(void) | ||
408 | { | ||
409 | /* Copied from eng_[openssl|dyn].c */ | ||
410 | ENGINE *toadd = engine_nuron(); | ||
411 | if(!toadd) return; | ||
412 | ENGINE_add(toadd); | ||
413 | ENGINE_free(toadd); | ||
414 | ERR_clear_error(); | ||
415 | } | ||
416 | #endif | ||
417 | |||
418 | /* This stuff is needed if this ENGINE is being compiled into a self-contained | ||
419 | * shared-library. */ | ||
420 | #ifndef OPENSSL_NO_DYNAMIC_ENGINE | ||
421 | static int bind_fn(ENGINE *e, const char *id) | ||
422 | { | ||
423 | if(id && (strcmp(id, engine_nuron_id) != 0)) | ||
424 | return 0; | ||
425 | if(!bind_helper(e)) | ||
426 | return 0; | ||
427 | return 1; | ||
428 | } | ||
429 | IMPLEMENT_DYNAMIC_CHECK_FN() | ||
430 | IMPLEMENT_DYNAMIC_BIND_FN(bind_fn) | ||
431 | #endif /* OPENSSL_NO_DYNAMIC_ENGINE */ | ||
432 | |||
433 | #endif /* !OPENSSL_NO_HW_NURON */ | ||
434 | #endif /* !OPENSSL_NO_HW */ | ||
diff --git a/src/lib/libssl/src/engines/e_nuron.ec b/src/lib/libssl/src/engines/e_nuron.ec deleted file mode 100644 index cfa430dfcd..0000000000 --- a/src/lib/libssl/src/engines/e_nuron.ec +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | L NURON e_nuron_err.h e_nuron_err.c | ||
diff --git a/src/lib/libssl/src/engines/e_nuron_err.c b/src/lib/libssl/src/engines/e_nuron_err.c deleted file mode 100644 index 9a7864f42f..0000000000 --- a/src/lib/libssl/src/engines/e_nuron_err.c +++ /dev/null | |||
@@ -1,146 +0,0 @@ | |||
1 | /* e_nuron_err.c */ | ||
2 | /* ==================================================================== | ||
3 | * Copyright (c) 1999-2005 The OpenSSL Project. All rights reserved. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions | ||
7 | * are met: | ||
8 | * | ||
9 | * 1. Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * | ||
12 | * 2. Redistributions in binary form must reproduce the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer in | ||
14 | * the documentation and/or other materials provided with the | ||
15 | * distribution. | ||
16 | * | ||
17 | * 3. All advertising materials mentioning features or use of this | ||
18 | * software must display the following acknowledgment: | ||
19 | * "This product includes software developed by the OpenSSL Project | ||
20 | * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" | ||
21 | * | ||
22 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
23 | * endorse or promote products derived from this software without | ||
24 | * prior written permission. For written permission, please contact | ||
25 | * openssl-core@OpenSSL.org. | ||
26 | * | ||
27 | * 5. Products derived from this software may not be called "OpenSSL" | ||
28 | * nor may "OpenSSL" appear in their names without prior written | ||
29 | * permission of the OpenSSL Project. | ||
30 | * | ||
31 | * 6. Redistributions of any form whatsoever must retain the following | ||
32 | * acknowledgment: | ||
33 | * "This product includes software developed by the OpenSSL Project | ||
34 | * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" | ||
35 | * | ||
36 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
37 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
38 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
39 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
40 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
41 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
42 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
44 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
45 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
46 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
47 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
48 | * ==================================================================== | ||
49 | * | ||
50 | * This product includes cryptographic software written by Eric Young | ||
51 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
52 | * Hudson (tjh@cryptsoft.com). | ||
53 | * | ||
54 | */ | ||
55 | |||
56 | /* NOTE: this file was auto generated by the mkerr.pl script: any changes | ||
57 | * made to it will be overwritten when the script next updates this file, | ||
58 | * only reason strings will be preserved. | ||
59 | */ | ||
60 | |||
61 | #include <stdio.h> | ||
62 | #include <openssl/err.h> | ||
63 | #include "e_nuron_err.h" | ||
64 | |||
65 | /* BEGIN ERROR CODES */ | ||
66 | #ifndef OPENSSL_NO_ERR | ||
67 | |||
68 | #define ERR_FUNC(func) ERR_PACK(0,func,0) | ||
69 | #define ERR_REASON(reason) ERR_PACK(0,0,reason) | ||
70 | |||
71 | static ERR_STRING_DATA NURON_str_functs[]= | ||
72 | { | ||
73 | {ERR_FUNC(NURON_F_NURON_CTRL), "NURON_CTRL"}, | ||
74 | {ERR_FUNC(NURON_F_NURON_FINISH), "NURON_FINISH"}, | ||
75 | {ERR_FUNC(NURON_F_NURON_INIT), "NURON_INIT"}, | ||
76 | {ERR_FUNC(NURON_F_NURON_MOD_EXP), "NURON_MOD_EXP"}, | ||
77 | {0,NULL} | ||
78 | }; | ||
79 | |||
80 | static ERR_STRING_DATA NURON_str_reasons[]= | ||
81 | { | ||
82 | {ERR_REASON(NURON_R_ALREADY_LOADED) ,"already loaded"}, | ||
83 | {ERR_REASON(NURON_R_CTRL_COMMAND_NOT_IMPLEMENTED),"ctrl command not implemented"}, | ||
84 | {ERR_REASON(NURON_R_DSO_FAILURE) ,"dso failure"}, | ||
85 | {ERR_REASON(NURON_R_DSO_FUNCTION_NOT_FOUND),"dso function not found"}, | ||
86 | {ERR_REASON(NURON_R_DSO_NOT_FOUND) ,"dso not found"}, | ||
87 | {ERR_REASON(NURON_R_NOT_LOADED) ,"not loaded"}, | ||
88 | {0,NULL} | ||
89 | }; | ||
90 | |||
91 | #endif | ||
92 | |||
93 | #ifdef NURON_LIB_NAME | ||
94 | static ERR_STRING_DATA NURON_lib_name[]= | ||
95 | { | ||
96 | {0 ,NURON_LIB_NAME}, | ||
97 | {0,NULL} | ||
98 | }; | ||
99 | #endif | ||
100 | |||
101 | |||
102 | static int NURON_lib_error_code=0; | ||
103 | static int NURON_error_init=1; | ||
104 | |||
105 | static void ERR_load_NURON_strings(void) | ||
106 | { | ||
107 | if (NURON_lib_error_code == 0) | ||
108 | NURON_lib_error_code=ERR_get_next_error_library(); | ||
109 | |||
110 | if (NURON_error_init) | ||
111 | { | ||
112 | NURON_error_init=0; | ||
113 | #ifndef OPENSSL_NO_ERR | ||
114 | ERR_load_strings(NURON_lib_error_code,NURON_str_functs); | ||
115 | ERR_load_strings(NURON_lib_error_code,NURON_str_reasons); | ||
116 | #endif | ||
117 | |||
118 | #ifdef NURON_LIB_NAME | ||
119 | NURON_lib_name->error = ERR_PACK(NURON_lib_error_code,0,0); | ||
120 | ERR_load_strings(0,NURON_lib_name); | ||
121 | #endif | ||
122 | } | ||
123 | } | ||
124 | |||
125 | static void ERR_unload_NURON_strings(void) | ||
126 | { | ||
127 | if (NURON_error_init == 0) | ||
128 | { | ||
129 | #ifndef OPENSSL_NO_ERR | ||
130 | ERR_unload_strings(NURON_lib_error_code,NURON_str_functs); | ||
131 | ERR_unload_strings(NURON_lib_error_code,NURON_str_reasons); | ||
132 | #endif | ||
133 | |||
134 | #ifdef NURON_LIB_NAME | ||
135 | ERR_unload_strings(0,NURON_lib_name); | ||
136 | #endif | ||
137 | NURON_error_init=1; | ||
138 | } | ||
139 | } | ||
140 | |||
141 | static void ERR_NURON_error(int function, int reason, char *file, int line) | ||
142 | { | ||
143 | if (NURON_lib_error_code == 0) | ||
144 | NURON_lib_error_code=ERR_get_next_error_library(); | ||
145 | ERR_PUT_error(NURON_lib_error_code,function,reason,file,line); | ||
146 | } | ||
diff --git a/src/lib/libssl/src/engines/e_nuron_err.h b/src/lib/libssl/src/engines/e_nuron_err.h deleted file mode 100644 index 219babbb45..0000000000 --- a/src/lib/libssl/src/engines/e_nuron_err.h +++ /dev/null | |||
@@ -1,90 +0,0 @@ | |||
1 | /* ==================================================================== | ||
2 | * Copyright (c) 2001 The OpenSSL Project. All rights reserved. | ||
3 | * | ||
4 | * Redistribution and use in source and binary forms, with or without | ||
5 | * modification, are permitted provided that the following conditions | ||
6 | * are met: | ||
7 | * | ||
8 | * 1. Redistributions of source code must retain the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer. | ||
10 | * | ||
11 | * 2. Redistributions in binary form must reproduce the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer in | ||
13 | * the documentation and/or other materials provided with the | ||
14 | * distribution. | ||
15 | * | ||
16 | * 3. All advertising materials mentioning features or use of this | ||
17 | * software must display the following acknowledgment: | ||
18 | * "This product includes software developed by the OpenSSL Project | ||
19 | * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
20 | * | ||
21 | * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
22 | * endorse or promote products derived from this software without | ||
23 | * prior written permission. For written permission, please contact | ||
24 | * openssl-core@openssl.org. | ||
25 | * | ||
26 | * 5. Products derived from this software may not be called "OpenSSL" | ||
27 | * nor may "OpenSSL" appear in their names without prior written | ||
28 | * permission of the OpenSSL Project. | ||
29 | * | ||
30 | * 6. Redistributions of any form whatsoever must retain the following | ||
31 | * acknowledgment: | ||
32 | * "This product includes software developed by the OpenSSL Project | ||
33 | * for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
34 | * | ||
35 | * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
36 | * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
37 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
38 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
39 | * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
40 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
41 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
42 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
43 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
44 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
45 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
46 | * OF THE POSSIBILITY OF SUCH DAMAGE. | ||
47 | * ==================================================================== | ||
48 | * | ||
49 | * This product includes cryptographic software written by Eric Young | ||
50 | * (eay@cryptsoft.com). This product includes software written by Tim | ||
51 | * Hudson (tjh@cryptsoft.com). | ||
52 | * | ||
53 | */ | ||
54 | |||
55 | #ifndef HEADER_NURON_ERR_H | ||
56 | #define HEADER_NURON_ERR_H | ||
57 | |||
58 | #ifdef __cplusplus | ||
59 | extern "C" { | ||
60 | #endif | ||
61 | |||
62 | /* BEGIN ERROR CODES */ | ||
63 | /* The following lines are auto generated by the script mkerr.pl. Any changes | ||
64 | * made after this point may be overwritten when the script is next run. | ||
65 | */ | ||
66 | static void ERR_load_NURON_strings(void); | ||
67 | static void ERR_unload_NURON_strings(void); | ||
68 | static void ERR_NURON_error(int function, int reason, char *file, int line); | ||
69 | #define NURONerr(f,r) ERR_NURON_error((f),(r),__FILE__,__LINE__) | ||
70 | |||
71 | /* Error codes for the NURON functions. */ | ||
72 | |||
73 | /* Function codes. */ | ||
74 | #define NURON_F_NURON_CTRL 100 | ||
75 | #define NURON_F_NURON_FINISH 101 | ||
76 | #define NURON_F_NURON_INIT 102 | ||
77 | #define NURON_F_NURON_MOD_EXP 103 | ||
78 | |||
79 | /* Reason codes. */ | ||
80 | #define NURON_R_ALREADY_LOADED 100 | ||
81 | #define NURON_R_CTRL_COMMAND_NOT_IMPLEMENTED 101 | ||
82 | #define NURON_R_DSO_FAILURE 102 | ||
83 | #define NURON_R_DSO_FUNCTION_NOT_FOUND 103 | ||
84 | #define NURON_R_DSO_NOT_FOUND 104 | ||
85 | #define NURON_R_NOT_LOADED 105 | ||
86 | |||
87 | #ifdef __cplusplus | ||
88 | } | ||
89 | #endif | ||
90 | #endif | ||