1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

* gpgsm.c (main): Add secmem features and set the random seed file.

(gpgsm_exit): Update the random seed file and enable debug output.

* g10.c (main): Add secmem features and set the random seed file.
(g10_exit): Update the random seed file.

* parse-packet.c (parse_signature,read_protected_v3_mpi)
(parse_key): Fixed use of mpi_set_opaque.
* keygen.c (gen_card_key): Ditto.
This commit is contained in:
Werner Koch 2003-07-29 08:53:19 +00:00
parent 979ed0ca26
commit 6f7ed05900
8 changed files with 510 additions and 252 deletions

View file

@ -1342,7 +1342,8 @@ parse_signature( iobuf_t inp, int pkttype, unsigned long pktlen,
unknown_pubkey_warning( sig->pubkey_algo );
/* we store the plain material in data[0], so that we are able
* to write it back with build_packet() */
sig->data[0] = mpi_set_opaque(NULL, read_rest(inp, pktlen), pktlen );
sig->data[0] = gcry_mpi_set_opaque(NULL, read_rest(inp, pktlen),
pktlen*8 );
pktlen = 0;
}
else {
@ -1446,7 +1447,7 @@ read_protected_v3_mpi (iobuf_t inp, unsigned long *length)
}
/* convert buffer into an opaque gcry_mpi_t */
val = mpi_set_opaque (NULL, buf, p-buf);
val = gcry_mpi_set_opaque (NULL, buf, (p-buf)*8);
return val;
}
@ -1565,8 +1566,8 @@ parse_key( iobuf_t inp, int pkttype, unsigned long pktlen,
size_t snlen = 0;
if( !npkey ) {
sk->skey[0] = mpi_set_opaque( NULL,
read_rest(inp, pktlen), pktlen );
sk->skey[0] = gcry_mpi_set_opaque( NULL, read_rest(inp, pktlen),
pktlen*8 );
pktlen = 0;
goto leave;
}
@ -1744,15 +1745,16 @@ parse_key( iobuf_t inp, int pkttype, unsigned long pktlen,
if( sk->protect.s2k.mode == 1001
|| sk->protect.s2k.mode == 1002 ) {
/* better set some dummy stuff here */
sk->skey[npkey] = mpi_set_opaque(NULL, xstrdup ("dummydata"), 10);
sk->skey[npkey] = gcry_mpi_set_opaque(NULL, xstrdup ("dummydata"),
10*8);
pktlen = 0;
}
else if( is_v4 && sk->is_protected ) {
/* ugly; the length is encrypted too, so we read all
* stuff up to the end of the packet into the first
* skey element */
sk->skey[npkey] = mpi_set_opaque(NULL,
read_rest(inp, pktlen), pktlen );
sk->skey[npkey] = gcry_mpi_set_opaque(NULL, read_rest(inp, pktlen),
pktlen*8 );
pktlen = 0;
if( list_mode ) {
printf("\tencrypted stuff follows\n");
@ -1792,8 +1794,8 @@ parse_key( iobuf_t inp, int pkttype, unsigned long pktlen,
PKT_public_key *pk = pkt->pkt.public_key;
if( !npkey ) {
pk->pkey[0] = mpi_set_opaque( NULL,
read_rest(inp, pktlen), pktlen );
pk->pkey[0] = gcry_mpi_set_opaque( NULL, read_rest(inp, pktlen),
pktlen*8 );
pktlen = 0;
goto leave;
}