mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* mpicoder.c (do_get_buffer): Don't remove leading zeros if the
MPI is marked as protected.
This commit is contained in:
parent
29e3108bb9
commit
a4750ea3de
2 changed files with 14 additions and 6 deletions
|
@ -363,12 +363,15 @@ do_get_buffer( MPI a, unsigned *nbytes, int *sign, int force_secure )
|
|||
#endif
|
||||
}
|
||||
|
||||
/* this is sub-optimal but we need to do the shift oepration because
|
||||
* the caller has to free the returned buffer */
|
||||
for(p=buffer; !*p && *nbytes; p++, --*nbytes )
|
||||
;
|
||||
if( p != buffer )
|
||||
memmove(buffer,p, *nbytes);
|
||||
if (!mpi_is_protected (a))
|
||||
{
|
||||
/* this is sub-optimal but we need to do the shift operation
|
||||
* because the caller has to free the returned buffer */
|
||||
for(p=buffer; !*p && *nbytes; p++, --*nbytes )
|
||||
;
|
||||
if( p != buffer )
|
||||
memmove(buffer,p, *nbytes);
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue