mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-24 15:17:02 +01:00
* build-packet.c (write_fake_data, do_secret_key), seckey-cert.c
(do_check): Use an unsigned length for mpi_get_opaque. * options.h: It's impolite to assign -1 to an unsigned opt.force_ownertrust.
This commit is contained in:
parent
e49672d5a3
commit
7847eae02c
@ -1,5 +1,11 @@
|
|||||||
2003-12-17 David Shaw <dshaw@localhost.localdomain>
|
2003-12-17 David Shaw <dshaw@localhost.localdomain>
|
||||||
|
|
||||||
|
* build-packet.c (write_fake_data, do_secret_key), seckey-cert.c
|
||||||
|
(do_check): Use an unsigned length for mpi_get_opaque.
|
||||||
|
|
||||||
|
* options.h: It's impolite to assign -1 to an unsigned
|
||||||
|
opt.force_ownertrust.
|
||||||
|
|
||||||
* sig-check.c (cmp_help, do_check), sign.c (do_sign): Remove old
|
* sig-check.c (cmp_help, do_check), sign.c (do_sign): Remove old
|
||||||
unused code.
|
unused code.
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ static void
|
|||||||
write_fake_data( IOBUF out, MPI a )
|
write_fake_data( IOBUF out, MPI a )
|
||||||
{
|
{
|
||||||
if( a ) {
|
if( a ) {
|
||||||
int i;
|
unsigned int i;
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
p = mpi_get_opaque( a, &i );
|
p = mpi_get_opaque( a, &i );
|
||||||
@ -353,15 +353,17 @@ do_secret_key( IOBUF out, int ctb, PKT_secret_key *sk )
|
|||||||
else if( sk->is_protected && sk->version >= 4 ) {
|
else if( sk->is_protected && sk->version >= 4 ) {
|
||||||
/* The secret key is protected - write it out as it is */
|
/* The secret key is protected - write it out as it is */
|
||||||
byte *p;
|
byte *p;
|
||||||
|
unsigned int ndata;
|
||||||
|
|
||||||
assert( mpi_is_opaque( sk->skey[npkey] ) );
|
assert( mpi_is_opaque( sk->skey[npkey] ) );
|
||||||
p = mpi_get_opaque( sk->skey[npkey], &i );
|
p = mpi_get_opaque( sk->skey[npkey], &ndata );
|
||||||
iobuf_write(a, p, i );
|
iobuf_write(a, p, ndata );
|
||||||
}
|
}
|
||||||
else if( sk->is_protected ) {
|
else if( sk->is_protected ) {
|
||||||
/* The secret key is protected te old v4 way. */
|
/* The secret key is protected te old v4 way. */
|
||||||
for( ; i < nskey; i++ ) {
|
for( ; i < nskey; i++ ) {
|
||||||
byte *p;
|
byte *p;
|
||||||
int ndata;
|
unsigned int ndata;
|
||||||
|
|
||||||
assert (mpi_is_opaque (sk->skey[i]));
|
assert (mpi_is_opaque (sk->skey[i]));
|
||||||
p = mpi_get_opaque (sk->skey[i], &ndata);
|
p = mpi_get_opaque (sk->skey[i], &ndata);
|
||||||
|
@ -97,7 +97,7 @@ struct {
|
|||||||
{
|
{
|
||||||
TM_CLASSIC=0, TM_PGP=1, TM_EXTERNAL=2, TM_ALWAYS, TM_AUTO
|
TM_CLASSIC=0, TM_PGP=1, TM_EXTERNAL=2, TM_ALWAYS, TM_AUTO
|
||||||
} trust_model;
|
} trust_model;
|
||||||
unsigned int force_ownertrust;
|
int force_ownertrust;
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
CO_GNUPG=0, CO_RFC2440, CO_RFC1991, CO_PGP2, CO_PGP6, CO_PGP7, CO_PGP8
|
CO_GNUPG=0, CO_RFC2440, CO_RFC1991, CO_PGP2, CO_PGP6, CO_PGP7, CO_PGP8
|
||||||
|
@ -86,7 +86,7 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
|
|||||||
cipher_setiv( cipher_hd, sk->protect.iv, sk->protect.ivlen );
|
cipher_setiv( cipher_hd, sk->protect.iv, sk->protect.ivlen );
|
||||||
csum = 0;
|
csum = 0;
|
||||||
if( sk->version >= 4 ) {
|
if( sk->version >= 4 ) {
|
||||||
int ndata;
|
unsigned int ndata;
|
||||||
byte *p, *data;
|
byte *p, *data;
|
||||||
u16 csumc = 0;
|
u16 csumc = 0;
|
||||||
|
|
||||||
@ -159,8 +159,7 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
|
|||||||
for(i=pubkey_get_npkey(sk->pubkey_algo);
|
for(i=pubkey_get_npkey(sk->pubkey_algo);
|
||||||
i < pubkey_get_nskey(sk->pubkey_algo); i++ ) {
|
i < pubkey_get_nskey(sk->pubkey_algo); i++ ) {
|
||||||
byte *p;
|
byte *p;
|
||||||
int ndata;
|
unsigned int ndata;
|
||||||
unsigned int dummy;
|
|
||||||
|
|
||||||
assert (mpi_is_opaque (sk->skey[i]));
|
assert (mpi_is_opaque (sk->skey[i]));
|
||||||
p = mpi_get_opaque (sk->skey[i], &ndata);
|
p = mpi_get_opaque (sk->skey[i], &ndata);
|
||||||
@ -173,8 +172,7 @@ do_check( PKT_secret_key *sk, const char *tryagain_text, int mode,
|
|||||||
cipher_decrypt (cipher_hd, buffer+2, p+2, ndata-2);
|
cipher_decrypt (cipher_hd, buffer+2, p+2, ndata-2);
|
||||||
csum += checksum (buffer, ndata);
|
csum += checksum (buffer, ndata);
|
||||||
mpi_free (sk->skey[i]);
|
mpi_free (sk->skey[i]);
|
||||||
dummy = ndata;
|
sk->skey[i] = mpi_read_from_buffer (buffer, &ndata, 1);
|
||||||
sk->skey[i] = mpi_read_from_buffer (buffer, &dummy, 1);
|
|
||||||
assert (sk->skey[i]);
|
assert (sk->skey[i]);
|
||||||
m_free (buffer);
|
m_free (buffer);
|
||||||
/* csum += checksum_mpi (sk->skey[i]); */
|
/* csum += checksum_mpi (sk->skey[i]); */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user