diff options
author | Werner Koch <wk@gnupg.org> | 1998-08-05 18:51:59 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 1998-08-05 18:51:59 +0200 |
commit | 9b609091ab3249a41c3a9f2417ba0250405792c8 (patch) | |
tree | eac3b271488722262dd71f003641d88d35fb64a1 /g10/free-packet.c | |
parent | add coprocess facility (diff) | |
download | gnupg2-9b609091ab3249a41c3a9f2417ba0250405792c8.tar.xz gnupg2-9b609091ab3249a41c3a9f2417ba0250405792c8.zip |
intermediate check in
Diffstat (limited to 'g10/free-packet.c')
-rw-r--r-- | g10/free-packet.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/g10/free-packet.c b/g10/free-packet.c index 14a466556..e6b228117 100644 --- a/g10/free-packet.c +++ b/g10/free-packet.c @@ -30,6 +30,7 @@ #include "util.h" #include "cipher.h" #include "memory.h" +#include "options.h" void free_symkey_enc( PKT_symkey_enc *enc ) @@ -82,6 +83,10 @@ release_public_key_parts( PKT_public_key *pk ) mpi_free( pk->pkey[i] ); pk->pkey[i] = NULL; } + if( pk->namehash ) { + m_free(pk->namehash); + pk->namehash = NULL; + } } @@ -123,13 +128,22 @@ cp_data_block( byte *s ) PKT_public_key * -copy_public_key( PKT_public_key *d, PKT_public_key *s ) +copy_public_key_new_namehash( PKT_public_key *d, PKT_public_key *s, + const byte *namehash ) { int n, i; if( !d ) d = m_alloc(sizeof *d); memcpy( d, s, sizeof *d ); + if( namehash ) { + d->namehash = m_alloc( 20 ); + memcpy(d->namehash, namehash, 20 ); + } + else if( s->namehash ) { + d->namehash = m_alloc( 20 ); + memcpy(d->namehash, s->namehash, 20 ); + } n = pubkey_get_npkey( s->pubkey_algo ); if( !n ) d->pkey[0] = cp_fake_data(s->pkey[0]); @@ -140,6 +154,11 @@ copy_public_key( PKT_public_key *d, PKT_public_key *s ) return d; } +PKT_public_key * +copy_public_key( PKT_public_key *d, PKT_public_key *s ) +{ + return copy_public_key_new_namehash( d, s, NULL ); +} PKT_signature * copy_signature( PKT_signature *d, PKT_signature *s ) |