mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
Removed the use of g10defs.h.
This required some code cleanups and the introduction of a few accessor ducntions in mpi.
This commit is contained in:
parent
d382fece03
commit
9f433cccca
29 changed files with 267 additions and 157 deletions
|
@ -1,3 +1,13 @@
|
|||
2006-12-11 Werner Koch <wk@g10code.com>
|
||||
|
||||
* 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 <wk@g10code.com>
|
||||
|
||||
* 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 <wk@g10code.com>
|
||||
|
||||
* 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 <wk@g10code.com>
|
||||
|
||||
* openfile.c (ask_outfile_name): Fixed buffer overflow occurring
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
14
g10/seskey.c
14
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 );
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue