diff options
author | miod <> | 2014-04-23 19:14:59 +0000 |
---|---|---|
committer | miod <> | 2014-04-23 19:14:59 +0000 |
commit | 822b26b553053ed1495769e7ee5346ac4b115459 (patch) | |
tree | 94f77f9c871657aea48524ce6d70046d642b0b20 | |
parent | 7d3606d4668ae166b87f774b3ca9be0c5202cdb9 (diff) | |
download | openbsd-822b26b553053ed1495769e7ee5346ac4b115459.tar.gz openbsd-822b26b553053ed1495769e7ee5346ac4b115459.tar.bz2 openbsd-822b26b553053ed1495769e7ee5346ac4b115459.zip |
I'm glad to know that Ultrix CC has a bug optimizing switch() statements
lacking an explicit `case 0:' construct. But Ultrix has been dead for more than
15 years, really. Don't give it any reason to move out of its coffin.
-rw-r--r-- | src/lib/libcrypto/bn/bn_lib.c | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/rc4/rc4_enc.c | 10 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/bn/bn_lib.c | 5 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/rc4/rc4_enc.c | 10 |
4 files changed, 0 insertions, 30 deletions
diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c index b491c785d4..c8de547ba5 100644 --- a/src/lib/libcrypto/bn/bn_lib.c +++ b/src/lib/libcrypto/bn/bn_lib.c | |||
@@ -345,10 +345,6 @@ static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) | |||
345 | case 3: A[2]=B[2]; | 345 | case 3: A[2]=B[2]; |
346 | case 2: A[1]=B[1]; | 346 | case 2: A[1]=B[1]; |
347 | case 1: A[0]=B[0]; | 347 | case 1: A[0]=B[0]; |
348 | case 0: /* workaround for ultrix cc: without 'case 0', the optimizer does | ||
349 | * the switch table by doing a=top&3; a--; goto jump_table[a]; | ||
350 | * which fails for top== 0 */ | ||
351 | ; | ||
352 | } | 348 | } |
353 | } | 349 | } |
354 | 350 | ||
@@ -500,7 +496,6 @@ BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) | |||
500 | case 3: A[2]=B[2]; | 496 | case 3: A[2]=B[2]; |
501 | case 2: A[1]=B[1]; | 497 | case 2: A[1]=B[1]; |
502 | case 1: A[0]=B[0]; | 498 | case 1: A[0]=B[0]; |
503 | case 0: ; /* ultrix cc workaround, see comments in bn_expand_internal */ | ||
504 | } | 499 | } |
505 | #else | 500 | #else |
506 | memcpy(a->d,b->d,sizeof(b->d[0])*b->top); | 501 | memcpy(a->d,b->d,sizeof(b->d[0])*b->top); |
diff --git a/src/lib/libcrypto/rc4/rc4_enc.c b/src/lib/libcrypto/rc4/rc4_enc.c index d8fc939dac..ec9d9e7b64 100644 --- a/src/lib/libcrypto/rc4/rc4_enc.c +++ b/src/lib/libcrypto/rc4/rc4_enc.c | |||
@@ -189,11 +189,6 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, | |||
189 | case 3: otp |= RC4_STEP<<i, i-=8; | 189 | case 3: otp |= RC4_STEP<<i, i-=8; |
190 | case 2: otp |= RC4_STEP<<i, i-=8; | 190 | case 2: otp |= RC4_STEP<<i, i-=8; |
191 | case 1: otp |= RC4_STEP<<i, i-=8; | 191 | case 1: otp |= RC4_STEP<<i, i-=8; |
192 | case 0: ; /* | ||
193 | * it's never the case, | ||
194 | * but it has to be here | ||
195 | * for ultrix? | ||
196 | */ | ||
197 | } | 192 | } |
198 | ochunk &= ~mask; | 193 | ochunk &= ~mask; |
199 | ochunk |= (otp^ichunk) & mask; | 194 | ochunk |= (otp^ichunk) & mask; |
@@ -242,11 +237,6 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, | |||
242 | case 3: otp |= RC4_STEP<<i, i+=8; | 237 | case 3: otp |= RC4_STEP<<i, i+=8; |
243 | case 2: otp |= RC4_STEP<<i, i+=8; | 238 | case 2: otp |= RC4_STEP<<i, i+=8; |
244 | case 1: otp |= RC4_STEP<<i, i+=8; | 239 | case 1: otp |= RC4_STEP<<i, i+=8; |
245 | case 0: ; /* | ||
246 | * it's never the case, | ||
247 | * but it has to be here | ||
248 | * for ultrix? | ||
249 | */ | ||
250 | } | 240 | } |
251 | ochunk &= ~mask; | 241 | ochunk &= ~mask; |
252 | ochunk |= (otp^ichunk) & mask; | 242 | ochunk |= (otp^ichunk) & mask; |
diff --git a/src/lib/libssl/src/crypto/bn/bn_lib.c b/src/lib/libssl/src/crypto/bn/bn_lib.c index b491c785d4..c8de547ba5 100644 --- a/src/lib/libssl/src/crypto/bn/bn_lib.c +++ b/src/lib/libssl/src/crypto/bn/bn_lib.c | |||
@@ -345,10 +345,6 @@ static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) | |||
345 | case 3: A[2]=B[2]; | 345 | case 3: A[2]=B[2]; |
346 | case 2: A[1]=B[1]; | 346 | case 2: A[1]=B[1]; |
347 | case 1: A[0]=B[0]; | 347 | case 1: A[0]=B[0]; |
348 | case 0: /* workaround for ultrix cc: without 'case 0', the optimizer does | ||
349 | * the switch table by doing a=top&3; a--; goto jump_table[a]; | ||
350 | * which fails for top== 0 */ | ||
351 | ; | ||
352 | } | 348 | } |
353 | } | 349 | } |
354 | 350 | ||
@@ -500,7 +496,6 @@ BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b) | |||
500 | case 3: A[2]=B[2]; | 496 | case 3: A[2]=B[2]; |
501 | case 2: A[1]=B[1]; | 497 | case 2: A[1]=B[1]; |
502 | case 1: A[0]=B[0]; | 498 | case 1: A[0]=B[0]; |
503 | case 0: ; /* ultrix cc workaround, see comments in bn_expand_internal */ | ||
504 | } | 499 | } |
505 | #else | 500 | #else |
506 | memcpy(a->d,b->d,sizeof(b->d[0])*b->top); | 501 | memcpy(a->d,b->d,sizeof(b->d[0])*b->top); |
diff --git a/src/lib/libssl/src/crypto/rc4/rc4_enc.c b/src/lib/libssl/src/crypto/rc4/rc4_enc.c index d8fc939dac..ec9d9e7b64 100644 --- a/src/lib/libssl/src/crypto/rc4/rc4_enc.c +++ b/src/lib/libssl/src/crypto/rc4/rc4_enc.c | |||
@@ -189,11 +189,6 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, | |||
189 | case 3: otp |= RC4_STEP<<i, i-=8; | 189 | case 3: otp |= RC4_STEP<<i, i-=8; |
190 | case 2: otp |= RC4_STEP<<i, i-=8; | 190 | case 2: otp |= RC4_STEP<<i, i-=8; |
191 | case 1: otp |= RC4_STEP<<i, i-=8; | 191 | case 1: otp |= RC4_STEP<<i, i-=8; |
192 | case 0: ; /* | ||
193 | * it's never the case, | ||
194 | * but it has to be here | ||
195 | * for ultrix? | ||
196 | */ | ||
197 | } | 192 | } |
198 | ochunk &= ~mask; | 193 | ochunk &= ~mask; |
199 | ochunk |= (otp^ichunk) & mask; | 194 | ochunk |= (otp^ichunk) & mask; |
@@ -242,11 +237,6 @@ void RC4(RC4_KEY *key, size_t len, const unsigned char *indata, | |||
242 | case 3: otp |= RC4_STEP<<i, i+=8; | 237 | case 3: otp |= RC4_STEP<<i, i+=8; |
243 | case 2: otp |= RC4_STEP<<i, i+=8; | 238 | case 2: otp |= RC4_STEP<<i, i+=8; |
244 | case 1: otp |= RC4_STEP<<i, i+=8; | 239 | case 1: otp |= RC4_STEP<<i, i+=8; |
245 | case 0: ; /* | ||
246 | * it's never the case, | ||
247 | * but it has to be here | ||
248 | * for ultrix? | ||
249 | */ | ||
250 | } | 240 | } |
251 | ochunk &= ~mask; | 241 | ochunk &= ~mask; |
252 | ochunk |= (otp^ichunk) & mask; | 242 | ochunk |= (otp^ichunk) & mask; |