rpms/openssl/devel openssl-0.9.7f-apps-initialize.patch, NONE, 1.1 openssl-0.9.7f-bn-ppc-div.patch, NONE, 1.1 openssl-0.9.7f-dsa-consttime.patch, NONE, 1.1 openssl-0.9.7f-can-2005-0109.patch, 1.1, 1.2 openssl.spec, 1.58, 1.59
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Tue Aug 23 15:28:55 UTC 2005
Author: tmraz
Update of /cvs/dist/rpms/openssl/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv26484
Modified Files:
openssl-0.9.7f-can-2005-0109.patch openssl.spec
Added Files:
openssl-0.9.7f-apps-initialize.patch
openssl-0.9.7f-bn-ppc-div.patch
openssl-0.9.7f-dsa-consttime.patch
Log Message:
* Tue Aug 23 2005 Tomas Mraz <tmraz at redhat.com> 0.9.7f-9
- add *.so.soversion as symlinks in /lib (#165264)
- remove unpackaged symlinks (#159595)
- fixes from upstream (constant time fixes for DSA,
bn assembler div on ppc arch, initialize memory on realloc)
openssl-0.9.7f-apps-initialize.patch:
apps.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
--- NEW FILE openssl-0.9.7f-apps-initialize.patch ---
openssl/apps/apps.c 1.49.2.32 -> 1.49.2.33
--- openssl/apps/apps.c 2005/06/27 16:00:57 1.49.2.32
+++ openssl/apps/apps.c 2005/07/01 16:13:06 1.49.2.33
@@ -361,10 +361,17 @@
/* The start of something good :-) */
if (num >= arg->count)
{
- arg->count+=20;
- arg->data=(char **)OPENSSL_realloc(arg->data,
- sizeof(char *)*arg->count);
- if (argc == 0) return(0);
+ char **tmp_p;
+ int tlen = arg->count + 20;
+ tmp_p = (char **)OPENSSL_realloc(arg->data,
+ sizeof(char *)*tlen);
+ if (tmp_p == NULL)
+ return 0;
+ arg->data = tmp_p;
+ arg->count = tlen;
+ /* initialize newly allocated data */
+ for (i = num; i < arg->count; i++)
+ arg->data[i] = NULL;
}
arg->data[num++]=p;
openssl-0.9.7f-bn-ppc-div.patch:
ppc.pl | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)
--- NEW FILE openssl-0.9.7f-bn-ppc-div.patch ---
openssl/crypto/bn/asm/ppc.pl 1.1.6.1 -> 1.1.6.2
--- openssl/crypto/bn/asm/ppc.pl 2004/12/20 13:15:51 1.1.6.1
+++ openssl/crypto/bn/asm/ppc.pl 2005/07/03 09:24:35 1.1.6.2
@@ -116,7 +116,7 @@
$UDIV= "divwu"; # unsigned divide
$UCMPI= "cmplwi"; # unsigned compare with immediate
$UCMP= "cmplw"; # unsigned compare
- $COUNTZ="cntlzw"; # count leading zeros
+ $CNTLZ= "cntlzw"; # count leading zeros
$SHL= "slw"; # shift left
$SHR= "srw"; # unsigned shift right
$SHRI= "srwi"; # unsigned shift right by immediate
@@ -124,6 +124,7 @@
$CLRU= "clrlwi"; # clear upper bits
$INSR= "insrwi"; # insert right
$ROTL= "rotlwi"; # rotate left by immediate
+ $TR= "tw"; # conditional trap
} elsif ($opf =~ /64\.s/) {
$BITS= 64;
$BNSZ= $BITS/8;
@@ -139,7 +140,7 @@
$UDIV= "divdu"; # unsigned divide
$UCMPI= "cmpldi"; # unsigned compare with immediate
$UCMP= "cmpld"; # unsigned compare
- $COUNTZ="cntlzd"; # count leading zeros
+ $CNTLZ= "cntlzd"; # count leading zeros
$SHL= "sld"; # shift left
$SHR= "srd"; # unsigned shift right
$SHRI= "srdi"; # unsigned shift right by immediate
@@ -147,6 +148,7 @@
$CLRU= "clrldi"; # clear upper bits
$INSR= "insrdi"; # insert right
$ROTL= "rotldi"; # rotate left by immediate
+ $TR= "td"; # conditional trap
} else { die "nonsense $opf"; }
( defined shift || open STDOUT,">$opf" ) || die "can't open $opf: $!";
@@ -1710,17 +1712,12 @@
bclr BO_ALWAYS,CR0_LT
Lppcasm_div1:
xor r0,r0,r0 #r0=0
- $COUNTZ r7,r5 #r7 = num leading 0s in d.
- subfic r8,r7,$BITS #r8 = BN_num_bits_word(d)
- cmpi 0,0,r8,$BITS #
- bc BO_IF,CR0_EQ,Lppcasm_div2 #proceed if (r8==$BITS)
- li r9,1 # r9=1
- $SHL r10,r9,r8 # r9<<=r8
- $UCMP 0,r3,r10 #
- bc BO_IF,CR0_GT,Lppcasm_div2 #or if (h > (1<<r8))
- $UDIV r3,r3,r0 #if not assert(0) divide by 0!
- #that's how we signal overflow
- bclr BO_ALWAYS,CR0_LT #return. NEVER REACHED.
+ li r8,$BITS
+ $CNTLZ. r7,r5 #r7 = num leading 0s in d.
+ bc BO_IF,CR0_EQ,Lppcasm_div2 #proceed if no leading zeros
+ subf r8,r7,r8 #r8 = BN_num_bits_word(d)
+ $SHR. r9,r3,r8 #are there any bits above r8'th?
+ $TR 16,r9,r0 #if there're, signal to dump core...
Lppcasm_div2:
$UCMP 0,r3,r5 #h>=d?
bc BO_IF,CR0_LT,Lppcasm_div3 #goto Lppcasm_div3 if not
openssl-0.9.7f-dsa-consttime.patch:
dsa_ossl.c | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
--- NEW FILE openssl-0.9.7f-dsa-consttime.patch ---
For DSA signing, unless DSA_FLAG_NO_EXP_CONSTTIME is set, perform
the exponentiation using a fixed-length exponent. (Otherwise,
the information leaked through timing could expose the secret key
after many signatures; cf. Bleichenbacher's attack on DSA with
biased k.)
openssl/crypto/dsa/dsa_ossl.c 1.12.2.9 -> 1.12.2.10
--- openssl/crypto/dsa/dsa_ossl.c 2005/05/16 01:26:04 1.12.2.9
+++ openssl/crypto/dsa/dsa_ossl.c 2005/05/26 04:40:42 1.12.2.10
@@ -172,7 +172,7 @@
static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
{
BN_CTX *ctx;
- BIGNUM k,*kinv=NULL,*r=NULL;
+ BIGNUM k,kq,*K,*kinv=NULL,*r=NULL;
int ret=0;
if (!dsa->p || !dsa->q || !dsa->g)
@@ -182,6 +182,7 @@
}
BN_init(&k);
+ BN_init(&kq);
if (ctx_in == NULL)
{
@@ -191,7 +192,6 @@
ctx=ctx_in;
if ((r=BN_new()) == NULL) goto err;
- kinv=NULL;
/* Get random k */
do
@@ -211,7 +211,30 @@
}
/* Compute r = (g^k mod p) mod q */
- if (!dsa->meth->bn_mod_exp(dsa, r,dsa->g,&k,dsa->p,ctx,
+
+ if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0)
+ {
+ if (!BN_copy(&kq, &k)) goto err;
+
+ /* We do not want timing information to leak the length of k,
+ * so we compute g^k using an equivalent exponent of fixed length.
+ *
+ * (This is a kludge that we need because the BN_mod_exp_mont()
+ * does not let us specify the desired timing behaviour.) */
+
+ if (!BN_add(&kq, &kq, dsa->q)) goto err;
+ if (BN_num_bits(&kq) <= BN_num_bits(dsa->q))
+ {
+ if (!BN_add(&kq, &kq, dsa->q)) goto err;
+ }
+
+ K = &kq;
+ }
+ else
+ {
+ K = &k;
+ }
+ if (!dsa->meth->bn_mod_exp(dsa, r,dsa->g,K,dsa->p,ctx,
(BN_MONT_CTX *)dsa->method_mont_p)) goto err;
if (!BN_mod(r,r,dsa->q,ctx)) goto err;
@@ -234,6 +257,7 @@
if (ctx_in == NULL) BN_CTX_free(ctx);
if (kinv != NULL) BN_clear_free(kinv);
BN_clear_free(&k);
+ BN_clear_free(&kq);
return(ret);
}
openssl-0.9.7f-can-2005-0109.patch:
apps/speed.c | 4
crypto/bn/bn.h | 17 +++
crypto/bn/bn_err.c | 4
crypto/bn/bn_exp.c | 244 +++++++++++++++++++++++++++++++++++++++++++++++++-
crypto/bn/bn_lcl.h | 39 +++++++
crypto/bn/bntest.c | 56 +++++++++++
crypto/bn/expspeed.c | 2
crypto/bn/exptest.c | 18 +++
crypto/dh/dh.h | 9 +
crypto/dh/dh_key.c | 27 ++++-
crypto/dh/dhtest.c | 4
crypto/dsa/dsa.h | 7 +
crypto/dsa/dsa_key.c | 15 ++-
crypto/dsa/dsa_ossl.c | 4
crypto/dsa/dsatest.c | 9 +
crypto/rsa/rsa.h | 31 +++---
crypto/rsa/rsa_eay.c | 120 +++++++++++++++++++++++-
crypto/rsa/rsa_test.c | 5 -
util/libeay.num | 1
19 files changed, 583 insertions(+), 33 deletions(-)
Index: openssl-0.9.7f-can-2005-0109.patch
===================================================================
RCS file: /cvs/dist/rpms/openssl/devel/openssl-0.9.7f-can-2005-0109.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- openssl-0.9.7f-can-2005-0109.patch 19 May 2005 09:17:54 -0000 1.1
+++ openssl-0.9.7f-can-2005-0109.patch 23 Aug 2005 15:28:52 -0000 1.2
@@ -438,7 +438,7 @@
{
if (BN_cmp(r_simple,r_mont) != 0)
printf("\nsimple and mont results differ\n");
-+ if (BN_cmp(r_simple,r_mont) != 0)
++ if (BN_cmp(r_simple,r_mont_const) != 0)
+ printf("\nsimple and mont const time results differ\n");
if (BN_cmp(r_simple,r_recp) != 0)
printf("\nsimple and recp results differ\n");
Index: openssl.spec
===================================================================
RCS file: /cvs/dist/rpms/openssl/devel/openssl.spec,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- openssl.spec 11 Aug 2005 10:16:19 -0000 1.58
+++ openssl.spec 23 Aug 2005 15:28:52 -0000 1.59
@@ -22,7 +22,7 @@
Summary: The OpenSSL toolkit.
Name: openssl
Version: 0.9.7f
-Release: 8
+Release: 9
Source: openssl-%{version}-usa.tar.bz2
Source1: hobble-openssl
Source2: Makefile.certificate
@@ -52,7 +52,9 @@
Patch45: openssl-0.9.7f-use-poll.patch
Patch46: openssl-0.9.7f-backport-097g.patch
Patch47: openssl-0.9.7f-can-2005-0109.patch
-
+Patch48: openssl-0.9.7f-dsa-consttime.patch
+Patch49: openssl-0.9.7f-bn-ppc-div.patch
+Patch50: openssl-0.9.7f-apps-initialize.patch
License: BSDish
Group: System Environment/Libraries
@@ -135,6 +137,9 @@
%patch46 -p1 -b .backport-097g
# CAN-2005-0109
%patch47 -p1 -b .modexp-consttime
+%patch48 -p1 -b .dsa-consttime
+%patch49 -p1 -b .ppc-div
+%patch50 -p1 -b .apps-initialize
# Modify the various perl scripts to reference perl in the right location.
perl util/perlpath.pl `dirname %{__perl}`
@@ -237,7 +242,8 @@
for lib in $RPM_BUILD_ROOT/%{_lib}/*.so.%{version} ; do
chmod 755 ${lib}
ln -s -f ../../%{_lib}/`basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`
- ln -s -f ../../%{_lib}/`basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`.%{soversion}
+ ln -s -f `basename ${lib}` $RPM_BUILD_ROOT/%{_lib}/`basename ${lib} .%{version}`.%{soversion}
+ rm -f $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`.%{soversion}
done
# Install a makefile for generating keys and self-signed certs, and a script
@@ -352,7 +358,9 @@
%doc doc/openssl_button.html doc/openssl_button.gif
%doc doc/ssleay.txt
%dir %{_sysconfdir}/pki/tls
-%{_sysconfdir}/pki/tls/certs
+%dir %{_sysconfdir}/pki/tls/certs
+%{_sysconfdir}/pki/tls/certs/make-dummy-cert
+%{_sysconfdir}/pki/tls/certs/Makefile
%{_sysconfdir}/pki/tls/cert.pem
%dir %{_sysconfdir}/pki/tls/misc
%{_sysconfdir}/pki/tls/misc/CA
@@ -362,10 +370,11 @@
%{_sysconfdir}/pki/tls/private
%config(noreplace) %{_sysconfdir}/pki/tls/openssl.cnf
-%config %{_sysconfdir}/pki/tls/certs/ca-bundle.crt
+%config(noreplace) %{_sysconfdir}/pki/tls/certs/ca-bundle.crt
%attr(0755,root,root) %{_bindir}/openssl
%attr(0755,root,root) /%{_lib}/*.so.%{version}
+%attr(0755,root,root) /%{_lib}/*.so.%{soversion}
%attr(0644,root,root) %{_mandir}/man1*/[ABD-Zabcd-z]*
%attr(0644,root,root) %{_mandir}/man5*/*
%attr(0644,root,root) %{_mandir}/man7*/*
@@ -398,6 +407,12 @@
%postun -p /sbin/ldconfig
%changelog
+* Tue Aug 23 2005 Tomas Mraz <tmraz at redhat.com> 0.9.7f-9
+- add *.so.soversion as symlinks in /lib (#165264)
+- remove unpackaged symlinks (#159595)
+- fixes from upstream (constant time fixes for DSA,
+ bn assembler div on ppc arch, initialize memory on realloc)
+
* Thu Aug 11 2005 Phil Knirsch <pknirsch at redhat.com> 0.9.7f-8
- Updated ICA engine IBM patch to latest upstream version.
More information about the fedora-cvs-commits
mailing list