commit | a0558e048419968c33e0c6d1a06e5118a08d1cfb | [log] [tgz] |
---|---|---|
author | Paul Bakker <p.j.bakker@polarssl.org> | Tue Sep 10 14:25:51 2013 +0200 |
committer | Paul Bakker <p.j.bakker@polarssl.org> | Tue Sep 10 14:25:51 2013 +0200 |
tree | 2e16b1c24f194f09f1e8da5549ee61cfc814e1c7 | |
parent | 43aff2aec4993e16bb5008affaae7058d370672c [diff] [blame] |
Check that the cipher GCM receives is a 128-bit-based cipher
diff --git a/library/gcm.c b/library/gcm.c index e041647..1dfc199 100644 --- a/library/gcm.c +++ b/library/gcm.c
@@ -117,6 +117,9 @@ if( cipher_info == NULL ) return( POLARSSL_ERR_GCM_BAD_INPUT ); + if( cipher_info->block_size != 16 ) + return( POLARSSL_ERR_GCM_BAD_INPUT ); + if( ( ret = cipher_init_ctx( &ctx->cipher_ctx, cipher_info ) ) != 0 ) return( ret );