diff options
| author | Werner Koch <[email protected]> | 2003-07-28 08:59:18 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2003-07-28 08:59:18 +0000 |
| commit | 979ed0ca26a5ae5538fc5b2aad0a8f2cdd2aae86 (patch) | |
| tree | cb331e2255292830b8ecfa68fa38005c98f7b2b4 /g10/misc.c | |
| parent | * g10.c: New command --card-status. (diff) | |
| download | gnupg-979ed0ca26a5ae5538fc5b2aad0a8f2cdd2aae86.tar.gz gnupg-979ed0ca26a5ae5538fc5b2aad0a8f2cdd2aae86.zip | |
Adjusted for use with current libgcrypt (1.1.42).
Diffstat (limited to 'g10/misc.c')
| -rw-r--r-- | g10/misc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/g10/misc.c b/g10/misc.c index 5cdad1598..ad04ce76f 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -122,14 +122,14 @@ checksum_mpi( gcry_mpi_t a ) byte *buffer; size_t nbytes; - rc = gcry_mpi_print( GCRYMPI_FMT_PGP, NULL, &nbytes, a ); + rc = gcry_mpi_print( GCRYMPI_FMT_PGP, NULL, 0, &nbytes, a ); if (rc) BUG (); /* fixme: for numbers not in secure memory we should use a stack * based buffer and only allocate a larger one if mpi_print return * an error */ - buffer = gcry_is_secure(a)? gcry_xmalloc_secure(nbytes) : gcry_xmalloc(nbytes); - rc = gcry_mpi_print( GCRYMPI_FMT_PGP, buffer, &nbytes, a ); + buffer = gcry_is_secure(a)? gcry_xmalloc_secure(nbytes):gcry_xmalloc(nbytes); + rc = gcry_mpi_print (GCRYMPI_FMT_PGP, buffer, nbytes, NULL, a ); if (rc) BUG (); csum = checksum (buffer, nbytes ); @@ -827,7 +827,7 @@ mpi_write( iobuf_t out, gcry_mpi_t a ) int rc; nbytes = (MAX_EXTERN_MPI_BITS+7)/8; - rc = gcry_mpi_print( GCRYMPI_FMT_PGP, buffer, &nbytes, a ); + rc = gcry_mpi_print (GCRYMPI_FMT_PGP, buffer, nbytes, &nbytes, a ); if( !rc ) rc = iobuf_write( out, buffer, nbytes ); @@ -891,7 +891,7 @@ mpi_read(iobuf_t inp, unsigned int *ret_nread, int secure) nread++; } nread += nbytes; - if( gcry_mpi_scan( &a, GCRYMPI_FMT_PGP, buf, &nread ) ) + if( gcry_mpi_scan( &a, GCRYMPI_FMT_PGP, buf, nread, &nread ) ) a = NULL; leave: @@ -961,9 +961,9 @@ mpi_print( FILE *fp, gcry_mpi_t a, int mode ) } else { int rc; - char *buffer; + unsigned char *buffer; - rc = gcry_mpi_aprint( GCRYMPI_FMT_HEX, (void **)&buffer, NULL, a ); + rc = gcry_mpi_aprint( GCRYMPI_FMT_HEX, &buffer, NULL, a ); assert( !rc ); fputs( buffer, fp ); n += strlen(buffer); |
