aboutsummaryrefslogtreecommitdiffstats
path: root/g10/parse-packet.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2003-07-29 08:53:19 +0000
committerWerner Koch <[email protected]>2003-07-29 08:53:19 +0000
commit6f7ed0590060cc013946e192f725545445e6c39f (patch)
tree4b3b9288bf43e704dd81d5507bb80debfe52f558 /g10/parse-packet.c
parentAdjusted for use with current libgcrypt (1.1.42). (diff)
downloadgnupg-6f7ed0590060cc013946e192f725545445e6c39f.tar.gz
gnupg-6f7ed0590060cc013946e192f725545445e6c39f.zip
* 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.
Diffstat (limited to '')
-rw-r--r--g10/parse-packet.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c
index 57a6d3d7b..f70cc3f69 100644
--- a/g10/parse-packet.c
+++ b/g10/parse-packet.c
@@ -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;
}