From: <pa...@us...> - 2003-10-06 12:55:16
|
Update of /cvsroot/fuse-emulator/libspectrum In directory sc8-pr-cvs1:/tmp/cvs-serv26921 Modified Files: crypto.c Log Message: Need only one error variable in get_hash. Index: crypto.c =================================================================== RCS file: /cvsroot/fuse-emulator/libspectrum/crypto.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** crypto.c 6 Oct 2003 12:52:50 -0000 1.7 --- crypto.c 6 Oct 2003 12:55:12 -0000 1.8 *************** *** 117,122 **** get_hash( gcry_sexp_t *hash, const libspectrum_byte *data, size_t data_length ) { ! libspectrum_error error; ! gcry_error_t gcrypt_error; char *digest; size_t digest_length; gcry_mpi_t hash_mpi; --- 117,121 ---- get_hash( gcry_sexp_t *hash, const libspectrum_byte *data, size_t data_length ) { ! gcry_error_t error; char *digest; size_t digest_length; gcry_mpi_t hash_mpi; *************** *** 132,141 **** gcry_md_hash_buffer( HASH_ALGORITHM, digest, data, data_length ); ! gcrypt_error = gcry_mpi_scan( &hash_mpi, GCRYMPI_FMT_USG, digest, ! digest_length, NULL ); ! if( gcrypt_error ) { libspectrum_print_error( LIBSPECTRUM_ERROR_LOGIC, "get_hash: error creating hash MPI: %s", ! gcry_strerror( gcrypt_error ) ); free( digest ); --- 131,140 ---- gcry_md_hash_buffer( HASH_ALGORITHM, digest, data, data_length ); ! error = gcry_mpi_scan( &hash_mpi, GCRYMPI_FMT_USG, digest, digest_length, ! NULL ); ! if( error ) { libspectrum_print_error( LIBSPECTRUM_ERROR_LOGIC, "get_hash: error creating hash MPI: %s", ! gcry_strerror( error ) ); free( digest ); *************** *** 145,153 **** free( digest ); ! gcrypt_error = gcry_sexp_build( hash, NULL, hash_format, hash_mpi ); ! if( gcrypt_error ) { libspectrum_print_error( LIBSPECTRUM_ERROR_LOGIC, "get_hash: error creating hash sexp: %s", ! gcry_strerror( gcrypt_error ) ); gcry_mpi_release( hash_mpi ); --- 144,152 ---- free( digest ); ! error = gcry_sexp_build( hash, NULL, hash_format, hash_mpi ); ! if( error ) { libspectrum_print_error( LIBSPECTRUM_ERROR_LOGIC, "get_hash: error creating hash sexp: %s", ! gcry_strerror( error ) ); gcry_mpi_release( hash_mpi ); |