aboutsummaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog15
-rw-r--r--g10/Makefile.am2
-rw-r--r--g10/gpg.c2
-rw-r--r--g10/gpgv.c2
-rw-r--r--g10/seskey.c14
-rw-r--r--g10/sign.c3
6 files changed, 27 insertions, 11 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index fb12dc708..cc7c7e27b 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,13 @@
+2006-12-11 Werner Koch <[email protected]>
+
+ * seskey.c (encode_session_key, do_encode_md): Use new
+ mpi_nlimb_hint_from_nbytes function.
+ * sign.c (do_sign): Ditto.
+
+ * Makefile.am (AM_CPPFLAGS): Define GNUPG_LIBDIR.
+ * gpgv.c (i18n_init): s/G10_LOCALEDIR/LOCALEDIR/.
+ * gpg.c (i18n_init): Ditto.
+
2006-12-07 Werner Koch <[email protected]>
* Makefile.am (AM_CPPFLAGS): Define GNUPG_DATADIR.
@@ -31,6 +41,11 @@
re-prompt for a passphrase to ensure the user has typed it
correctly. Defaults to 1.
+2006-12-02 Werner Koch <[email protected]>
+
+ * encr-data.c: Allocate DFX context on the heap and not on the
+ stack. Changes at several places. Fixes CVE-2006-6235.
+
2006-11-27 Werner Koch <[email protected]>
* openfile.c (ask_outfile_name): Fixed buffer overflow occurring
diff --git a/g10/Makefile.am b/g10/Makefile.am
index 0e7886190..86a629ea9 100644
--- a/g10/Makefile.am
+++ b/g10/Makefile.am
@@ -26,8 +26,10 @@ EXTRA_DIST = options.skel
#OMIT_DEPENDENCIES = zlib.h zconf.h
if ! HAVE_DOSISH_SYSTEM
+AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\""
AM_CPPFLAGS += -DGNUPG_LIBEXECDIR="\"$(libexecdir)/@PACKAGE@\""
AM_CPPFLAGS += -DGNUPG_DATADIR="\"$(pkgdatadir)\""
+AM_CPPFLAGS += -DGNUPG_LIBDIR="\"$(libdir)/@PACKAGE@\""
endif
needed_libs = ../cipher/libcipher.a ../mpi/libmpi.a ../util/libutil.a
diff --git a/g10/gpg.c b/g10/gpg.c
index 691cfffa2..1d15d8f03 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -886,7 +886,7 @@ i18n_init(void)
#else
#ifdef ENABLE_NLS
setlocale( LC_ALL, "" );
- bindtextdomain( PACKAGE, G10_LOCALEDIR );
+ bindtextdomain (PACKAGE, LOCALEDIR);
textdomain( PACKAGE );
#endif
#endif
diff --git a/g10/gpgv.c b/g10/gpgv.c
index 5192c26fc..b643f0c9e 100644
--- a/g10/gpgv.c
+++ b/g10/gpgv.c
@@ -122,7 +122,7 @@ i18n_init(void)
#else
#ifdef ENABLE_NLS
setlocale( LC_ALL, "" );
- bindtextdomain( PACKAGE, G10_LOCALEDIR );
+ bindtextdomain (PACKAGE, LOCALEDIR);
textdomain( PACKAGE );
#endif
#endif
diff --git a/g10/seskey.c b/g10/seskey.c
index dd4dc0b6d..b25980312 100644
--- a/g10/seskey.c
+++ b/g10/seskey.c
@@ -138,7 +138,7 @@ encode_session_key( DEK *dek, unsigned nbits )
frame[n++] = csum >>8;
frame[n++] = csum;
assert( n == nframe );
- a = mpi_alloc_secure( (nframe+BYTES_PER_MPI_LIMB-1) / BYTES_PER_MPI_LIMB );
+ a = mpi_alloc_secure ( mpi_nlimb_hint_from_nbytes (nframe) );
mpi_set_buffer( a, frame, nframe, 0 );
xfree(frame);
return a;
@@ -175,9 +175,9 @@ do_encode_md( MD_HANDLE md, int algo, size_t len, unsigned nbits,
memcpy( frame+n, asn, asnlen ); n += asnlen;
memcpy( frame+n, md_read(md, algo), len ); n += len;
assert( n == nframe );
- a = md_is_secure(md)?
- mpi_alloc_secure( (nframe+BYTES_PER_MPI_LIMB-1) / BYTES_PER_MPI_LIMB )
- : mpi_alloc( (nframe+BYTES_PER_MPI_LIMB-1) / BYTES_PER_MPI_LIMB );
+ a = (md_is_secure(md)
+ ? mpi_alloc_secure ( mpi_nlimb_hint_from_nbytes (nframe) )
+ : mpi_alloc ( mpi_nlimb_hint_from_nbytes (nframe )));
mpi_set_buffer( a, frame, nframe, 0 );
xfree(frame);
@@ -250,9 +250,9 @@ encode_md_value( PKT_public_key *pk, PKT_secret_key *sk,
return NULL;
}
- frame = md_is_secure(md)? mpi_alloc_secure((qbytes+BYTES_PER_MPI_LIMB-1)
- / BYTES_PER_MPI_LIMB )
- : mpi_alloc((qbytes+BYTES_PER_MPI_LIMB-1) / BYTES_PER_MPI_LIMB );
+ frame = (md_is_secure(md)
+ ? mpi_alloc_secure (mpi_nlimb_hint_from_nbytes (qbytes) )
+ : mpi_alloc ( mpi_nlimb_hint_from_nbytes (qbytes) ));
mpi_set_buffer( frame, md_read(md, hash_algo), qbytes, 0 );
}
diff --git a/g10/sign.c b/g10/sign.c
index 82076d78d..59d9fa204 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -308,8 +308,7 @@ do_sign( PKT_secret_key *sk, PKT_signature *sig,
xfree (snbuf);
if (!rc)
{
- sig->data[0] = mpi_alloc ( (rbuflen+BYTES_PER_MPI_LIMB-1)
- / BYTES_PER_MPI_LIMB );
+ sig->data[0] = mpi_alloc ( mpi_nlimb_hint_from_nbytes (rbuflen) );
mpi_set_buffer (sig->data[0], rbuf, rbuflen, 0);
xfree (rbuf);
}