summaryrefslogtreecommitdiff
path: root/deps/openssl/openssl/crypto/bn/bn_shift.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-04-26 14:49:54 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-04-29 12:12:33 +0200
commit4fdb8acdaef4c3cb1d855e992ada0e63fee520a6 (patch)
tree4b2a796fadb3060c6952c5521c292da209b4adfb /deps/openssl/openssl/crypto/bn/bn_shift.c
parent626d7abdb43b672a6153510561afdd8856b7770f (diff)
downloadandroid-node-v8-4fdb8acdaef4c3cb1d855e992ada0e63fee520a6.tar.gz
android-node-v8-4fdb8acdaef4c3cb1d855e992ada0e63fee520a6.tar.bz2
android-node-v8-4fdb8acdaef4c3cb1d855e992ada0e63fee520a6.zip
deps: downgrade openssl to v1.0.0f
Several people have reported issues with IIS and Resin servers (or maybe SSL terminators sitting in front of those servers) that are fixed by downgrading OpenSSL. The AESNI performance improvements were nice but stability is more important. Downgrade OpenSSL from 1.0.1e to 1.0.0f. Fixes #5360 (and others).
Diffstat (limited to 'deps/openssl/openssl/crypto/bn/bn_shift.c')
-rw-r--r--deps/openssl/openssl/crypto/bn/bn_shift.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/deps/openssl/openssl/crypto/bn/bn_shift.c b/deps/openssl/openssl/crypto/bn/bn_shift.c
index a6fca2c424..c4d301afc4 100644
--- a/deps/openssl/openssl/crypto/bn/bn_shift.c
+++ b/deps/openssl/openssl/crypto/bn/bn_shift.c
@@ -99,7 +99,7 @@ int BN_lshift1(BIGNUM *r, const BIGNUM *a)
int BN_rshift1(BIGNUM *r, const BIGNUM *a)
{
BN_ULONG *ap,*rp,t,c;
- int i,j;
+ int i;
bn_check_top(r);
bn_check_top(a);
@@ -109,25 +109,22 @@ int BN_rshift1(BIGNUM *r, const BIGNUM *a)
BN_zero(r);
return(1);
}
- i = a->top;
- ap= a->d;
- j = i-(ap[i-1]==1);
if (a != r)
{
- if (bn_wexpand(r,j) == NULL) return(0);
+ if (bn_wexpand(r,a->top) == NULL) return(0);
+ r->top=a->top;
r->neg=a->neg;
}
+ ap=a->d;
rp=r->d;
- t=ap[--i];
- c=(t&1)?BN_TBIT:0;
- if (t>>=1) rp[i]=t;
- while (i>0)
+ c=0;
+ for (i=a->top-1; i>=0; i--)
{
- t=ap[--i];
+ t=ap[i];
rp[i]=((t>>1)&BN_MASK2)|c;
c=(t&1)?BN_TBIT:0;
}
- r->top=j;
+ bn_correct_top(r);
bn_check_top(r);
return(1);
}
@@ -185,11 +182,10 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
BN_zero(r);
return(1);
}
- i = (BN_num_bits(a)-n+(BN_BITS2-1))/BN_BITS2;
if (r != a)
{
r->neg=a->neg;
- if (bn_wexpand(r,i) == NULL) return(0);
+ if (bn_wexpand(r,a->top-nw+1) == NULL) return(0);
}
else
{
@@ -200,7 +196,7 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
f= &(a->d[nw]);
t=r->d;
j=a->top-nw;
- r->top=i;
+ r->top=j;
if (rb == 0)
{
@@ -216,8 +212,9 @@ int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
l= *(f++);
*(t++) =(tmp|(l<<lb))&BN_MASK2;
}
- if ((l = (l>>rb)&BN_MASK2)) *(t) = l;
+ *(t++) =(l>>rb)&BN_MASK2;
}
+ bn_correct_top(r);
bn_check_top(r);
return(1);
}