crypt_and_hash: check MAC earlier
This commit is contained in:
parent
da1ff38715
commit
0f2eacbd09
@ -455,17 +455,6 @@ int main( int argc, char *argv[] )
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Write the final block of data
|
||||
*/
|
||||
cipher_finish( &cipher_ctx, output, &olen );
|
||||
|
||||
if( fwrite( output, 1, olen, fout ) != olen )
|
||||
{
|
||||
fprintf( stderr, "fwrite(%ld bytes) failed\n", (long) olen );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Verify the message authentication code.
|
||||
*/
|
||||
@ -488,6 +477,17 @@ int main( int argc, char *argv[] )
|
||||
"or file corrupted.\n" );
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Write the final block of data
|
||||
*/
|
||||
cipher_finish( &cipher_ctx, output, &olen );
|
||||
|
||||
if( fwrite( output, 1, olen, fout ) != olen )
|
||||
{
|
||||
fprintf( stderr, "fwrite(%ld bytes) failed\n", (long) olen );
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user