mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
Verify created signatures.
This commit is contained in:
parent
f3b2ef0b93
commit
3b866e74a8
11 changed files with 73 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
|||
2001-03-24 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* mpi-mul.c (mpi_mul): Make sure that secret temporary results are
|
||||
not stored in w. Suggested by Florian Weimer.
|
||||
|
||||
2001-03-18 Werner Koch <wk@gnupg.org>
|
||||
|
||||
* config.links (mpi_sflags): Use i386 code for i386. According to
|
||||
|
|
|
@ -120,6 +120,7 @@ mpi_mul( MPI w, MPI u, MPI v)
|
|||
int assign_wp=0;
|
||||
mpi_ptr_t tmp_limb=NULL;
|
||||
|
||||
|
||||
if( u->nlimbs < v->nlimbs ) { /* Swap U and V. */
|
||||
usize = v->nlimbs;
|
||||
usign = v->sign;
|
||||
|
@ -145,7 +146,15 @@ mpi_mul( MPI w, MPI u, MPI v)
|
|||
|
||||
/* Ensure W has space enough to store the result. */
|
||||
wsize = usize + vsize;
|
||||
if( w->alloced < wsize ) {
|
||||
if ( !mpi_is_secure (w) && (mpi_is_secure (u) || mpi_is_secure (v)) ) {
|
||||
/* w is not allocated in secure space but u or v is. To make sure
|
||||
* that no temporray results are stored in w, we temporary use
|
||||
* a newly allocated limb space for w */
|
||||
wp = mpi_alloc_limb_space( wsize, 1 );
|
||||
assign_wp = 2; /* mark it as 2 so that we can later copy it back to
|
||||
* mormal memory */
|
||||
}
|
||||
else if( w->alloced < wsize ) {
|
||||
if( wp == up || wp == vp ) {
|
||||
wp = mpi_alloc_limb_space( wsize, mpi_is_secure(w) );
|
||||
assign_wp = 1;
|
||||
|
@ -180,8 +189,16 @@ mpi_mul( MPI w, MPI u, MPI v)
|
|||
wsize -= cy? 0:1;
|
||||
}
|
||||
|
||||
if( assign_wp )
|
||||
if( assign_wp ) {
|
||||
if (assign_wp == 2) {
|
||||
/* copy the temp wp from secure memory back to normal memory */
|
||||
mpi_ptr_t tmp_wp = mpi_alloc_limb_space (wsize, 0);
|
||||
MPN_COPY (tmp_wp, wp, wsize);
|
||||
mpi_free_limb_space (wp);
|
||||
wp = tmp_wp;
|
||||
}
|
||||
mpi_assign_limb_space( w, wp, wsize );
|
||||
}
|
||||
w->nlimbs = wsize;
|
||||
w->sign = sign_product;
|
||||
if( tmp_limb )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue