mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-03 23:43:40 +00:00
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.
|
* Verify the message authentication code.
|
||||||
*/
|
*/
|
||||||
@ -488,6 +477,17 @@ int main( int argc, char *argv[] )
|
|||||||
"or file corrupted.\n" );
|
"or file corrupted.\n" );
|
||||||
goto exit;
|
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;
|
ret = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user