Loading CHANGES +5 −0 Original line number Diff line number Diff line Loading @@ -794,6 +794,11 @@ Changes between 0.9.7g and 0.9.7h [XX xxx XXXX] *) New function BN_MONT_CTX_set_locked() to set montgomery parameters in a threadsafe manner. Modify rsa code to use new function and add calls to dsa and dh code (which had race conditions before). [Steve Henson] *) Include the fixed error library code in the C error file definitions instead of fixing them up at runtime. This keeps the error code structures constant. Loading ChangeLog.0_9_7-stable_not-in-head +0 −28 Original line number Diff line number Diff line Loading @@ -837,31 +837,3 @@ be added to the end of this file. Enable shared link on HP-UX. 2005-04-22 07:17 steve Changed: CHANGES (1.977.2.156), "Exp", lines: +5 -0 crypto/bn/bn.h (1.66.2.4), "Exp", lines: +2 -0 crypto/bn/bn_mont.c (1.30.2.3), "Exp", lines: +20 -0 crypto/dh/dh_key.c (1.16.2.4), "Exp", lines: +14 -10 crypto/dsa/dsa_ossl.c (1.12.2.7), "Exp", lines: +12 -9 crypto/rsa/rsa_eay.c (1.28.2.10), "Exp", lines: +16 -90 fips/fipshashes.c (1.1.2.5), "Exp", lines: +3 -3 fips/dh/fips_dh_key.c (1.1.2.4), "Exp", lines: +13 -10 fips/dsa/fips_dsa_ossl.c (1.1.2.8), "Exp", lines: +12 -9 fips/rsa/fips_rsa_eay.c (1.1.4.5), "Exp", lines: +17 -90 New function BN_MONT_CTX_set_locked, to set montgomery parameters in a threadsafe manner. Modify or add calls to use it in rsa, dsa and dh algorithms. 2005-04-23 06:46 nils Changed: crypto/dsa/dsa_ossl.c (1.12.2.8), "Exp", lines: +1 -1 crypto/rsa/rsa_eay.c (1.28.2.11), "Exp", lines: +4 -4 fix typo crypto/bn/bn.h +2 −0 Original line number Diff line number Diff line Loading @@ -510,6 +510,8 @@ int BN_from_montgomery(BIGNUM *r,const BIGNUM *a, void BN_MONT_CTX_free(BN_MONT_CTX *mont); int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx); BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from); BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, const BIGNUM *mod, BN_CTX *ctx); /* BN_BLINDING flags */ #define BN_BLINDING_NO_UPDATE 0x00000001 Loading crypto/bn/bn_mont.c +18 −0 Original line number Diff line number Diff line Loading @@ -350,3 +350,21 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from) return(to); } BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, const BIGNUM *mod, BN_CTX *ctx) { if (*pmont) return *pmont; CRYPTO_w_lock(lock); if (!*pmont) { *pmont = BN_MONT_CTX_new(); if (*pmont && !BN_MONT_CTX_set(*pmont, mod, ctx)) { BN_MONT_CTX_free(*pmont); *pmont = NULL; } } CRYPTO_w_unlock(lock); return *pmont; } crypto/dh/dh_key.c +14 −10 Original line number Diff line number Diff line Loading @@ -127,13 +127,15 @@ static int generate_key(DH *dh) else pub_key=dh->pub_key; if ((dh->method_mont_p == NULL) && (dh->flags & DH_FLAG_CACHE_MONT_P)) if (dh->flags & DH_FLAG_CACHE_MONT_P) { if ((dh->method_mont_p=(char *)BN_MONT_CTX_new()) != NULL) if (!BN_MONT_CTX_set((BN_MONT_CTX *)dh->method_mont_p, dh->p,ctx)) goto err; mont = BN_MONT_CTX_set_locked( (BN_MONT_CTX **)&dh->method_mont_p, CRYPTO_LOCK_DH, dh->p, ctx); if (!mont) goto err; } mont=(BN_MONT_CTX *)dh->method_mont_p; if (generate_new_key) { Loading Loading @@ -173,14 +175,16 @@ static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) DHerr(DH_F_COMPUTE_KEY,DH_R_NO_PRIVATE_VALUE); goto err; } if ((dh->method_mont_p == NULL) && (dh->flags & DH_FLAG_CACHE_MONT_P)) if (dh->flags & DH_FLAG_CACHE_MONT_P) { if ((dh->method_mont_p=(char *)BN_MONT_CTX_new()) != NULL) if (!BN_MONT_CTX_set((BN_MONT_CTX *)dh->method_mont_p, dh->p,ctx)) goto err; mont = BN_MONT_CTX_set_locked( (BN_MONT_CTX **)&dh->method_mont_p, CRYPTO_LOCK_DH, dh->p, ctx); if (!mont) goto err; } mont=(BN_MONT_CTX *)dh->method_mont_p; if (!dh->meth->bn_mod_exp(dh, tmp, pub_key, dh->priv_key,dh->p,ctx,mont)) { DHerr(DH_F_COMPUTE_KEY,ERR_R_BN_LIB); Loading Loading
CHANGES +5 −0 Original line number Diff line number Diff line Loading @@ -794,6 +794,11 @@ Changes between 0.9.7g and 0.9.7h [XX xxx XXXX] *) New function BN_MONT_CTX_set_locked() to set montgomery parameters in a threadsafe manner. Modify rsa code to use new function and add calls to dsa and dh code (which had race conditions before). [Steve Henson] *) Include the fixed error library code in the C error file definitions instead of fixing them up at runtime. This keeps the error code structures constant. Loading
ChangeLog.0_9_7-stable_not-in-head +0 −28 Original line number Diff line number Diff line Loading @@ -837,31 +837,3 @@ be added to the end of this file. Enable shared link on HP-UX. 2005-04-22 07:17 steve Changed: CHANGES (1.977.2.156), "Exp", lines: +5 -0 crypto/bn/bn.h (1.66.2.4), "Exp", lines: +2 -0 crypto/bn/bn_mont.c (1.30.2.3), "Exp", lines: +20 -0 crypto/dh/dh_key.c (1.16.2.4), "Exp", lines: +14 -10 crypto/dsa/dsa_ossl.c (1.12.2.7), "Exp", lines: +12 -9 crypto/rsa/rsa_eay.c (1.28.2.10), "Exp", lines: +16 -90 fips/fipshashes.c (1.1.2.5), "Exp", lines: +3 -3 fips/dh/fips_dh_key.c (1.1.2.4), "Exp", lines: +13 -10 fips/dsa/fips_dsa_ossl.c (1.1.2.8), "Exp", lines: +12 -9 fips/rsa/fips_rsa_eay.c (1.1.4.5), "Exp", lines: +17 -90 New function BN_MONT_CTX_set_locked, to set montgomery parameters in a threadsafe manner. Modify or add calls to use it in rsa, dsa and dh algorithms. 2005-04-23 06:46 nils Changed: crypto/dsa/dsa_ossl.c (1.12.2.8), "Exp", lines: +1 -1 crypto/rsa/rsa_eay.c (1.28.2.11), "Exp", lines: +4 -4 fix typo
crypto/bn/bn.h +2 −0 Original line number Diff line number Diff line Loading @@ -510,6 +510,8 @@ int BN_from_montgomery(BIGNUM *r,const BIGNUM *a, void BN_MONT_CTX_free(BN_MONT_CTX *mont); int BN_MONT_CTX_set(BN_MONT_CTX *mont,const BIGNUM *mod,BN_CTX *ctx); BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to,BN_MONT_CTX *from); BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, const BIGNUM *mod, BN_CTX *ctx); /* BN_BLINDING flags */ #define BN_BLINDING_NO_UPDATE 0x00000001 Loading
crypto/bn/bn_mont.c +18 −0 Original line number Diff line number Diff line Loading @@ -350,3 +350,21 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from) return(to); } BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock, const BIGNUM *mod, BN_CTX *ctx) { if (*pmont) return *pmont; CRYPTO_w_lock(lock); if (!*pmont) { *pmont = BN_MONT_CTX_new(); if (*pmont && !BN_MONT_CTX_set(*pmont, mod, ctx)) { BN_MONT_CTX_free(*pmont); *pmont = NULL; } } CRYPTO_w_unlock(lock); return *pmont; }
crypto/dh/dh_key.c +14 −10 Original line number Diff line number Diff line Loading @@ -127,13 +127,15 @@ static int generate_key(DH *dh) else pub_key=dh->pub_key; if ((dh->method_mont_p == NULL) && (dh->flags & DH_FLAG_CACHE_MONT_P)) if (dh->flags & DH_FLAG_CACHE_MONT_P) { if ((dh->method_mont_p=(char *)BN_MONT_CTX_new()) != NULL) if (!BN_MONT_CTX_set((BN_MONT_CTX *)dh->method_mont_p, dh->p,ctx)) goto err; mont = BN_MONT_CTX_set_locked( (BN_MONT_CTX **)&dh->method_mont_p, CRYPTO_LOCK_DH, dh->p, ctx); if (!mont) goto err; } mont=(BN_MONT_CTX *)dh->method_mont_p; if (generate_new_key) { Loading Loading @@ -173,14 +175,16 @@ static int compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) DHerr(DH_F_COMPUTE_KEY,DH_R_NO_PRIVATE_VALUE); goto err; } if ((dh->method_mont_p == NULL) && (dh->flags & DH_FLAG_CACHE_MONT_P)) if (dh->flags & DH_FLAG_CACHE_MONT_P) { if ((dh->method_mont_p=(char *)BN_MONT_CTX_new()) != NULL) if (!BN_MONT_CTX_set((BN_MONT_CTX *)dh->method_mont_p, dh->p,ctx)) goto err; mont = BN_MONT_CTX_set_locked( (BN_MONT_CTX **)&dh->method_mont_p, CRYPTO_LOCK_DH, dh->p, ctx); if (!mont) goto err; } mont=(BN_MONT_CTX *)dh->method_mont_p; if (!dh->meth->bn_mod_exp(dh, tmp, pub_key, dh->priv_key,dh->p,ctx,mont)) { DHerr(DH_F_COMPUTE_KEY,ERR_R_BN_LIB); Loading