diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2020-03-05 22:41:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-05 22:41:37 +0100 |
| commit | da05ca6720cd64c3e0a615b9d1efc31305d759d6 (patch) | |
| tree | c840d1508b0fa5f2c62895ae946e6b7a3a0308d4 /thirdparty/mbedtls/library/cipher.c | |
| parent | 93f7c63ba5f14a963c6857eb61dbc032d6d3b66d (diff) | |
| parent | e435bed84708edb0c14fb94529fba7665966324f (diff) | |
| download | redot-engine-da05ca6720cd64c3e0a615b9d1efc31305d759d6.tar.gz | |
Merge pull request #36823 from akien-mga/mbedtls-2.16.5
mbedtls: Update to upstream version 2.16.5
Diffstat (limited to 'thirdparty/mbedtls/library/cipher.c')
| -rw-r--r-- | thirdparty/mbedtls/library/cipher.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/thirdparty/mbedtls/library/cipher.c b/thirdparty/mbedtls/library/cipher.c index 273997577b..8d010b59ac 100644 --- a/thirdparty/mbedtls/library/cipher.c +++ b/thirdparty/mbedtls/library/cipher.c @@ -361,6 +361,10 @@ int mbedtls_cipher_update( mbedtls_cipher_context_t *ctx, const unsigned char *i *olen = 0; block_size = mbedtls_cipher_get_block_size( ctx ); + if ( 0 == block_size ) + { + return( MBEDTLS_ERR_CIPHER_INVALID_CONTEXT ); + } if( ctx->cipher_info->mode == MBEDTLS_MODE_ECB ) { @@ -396,11 +400,6 @@ int mbedtls_cipher_update( mbedtls_cipher_context_t *ctx, const unsigned char *i } #endif - if ( 0 == block_size ) - { - return( MBEDTLS_ERR_CIPHER_INVALID_CONTEXT ); - } - if( input == output && ( ctx->unprocessed_len != 0 || ilen % block_size ) ) { @@ -459,11 +458,6 @@ int mbedtls_cipher_update( mbedtls_cipher_context_t *ctx, const unsigned char *i */ if( 0 != ilen ) { - if( 0 == block_size ) - { - return( MBEDTLS_ERR_CIPHER_INVALID_CONTEXT ); - } - /* Encryption: only cache partial blocks * Decryption w/ padding: always keep at least one whole block * Decryption w/o padding: only cache partial blocks |
