mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/berrange/tags/pull-qcrypto-2017-02-27-1' into staging
Merge qcrypto 2017/02/27 v1 # gpg: Signature made Mon 27 Feb 2017 13:37:34 GMT # gpg: using RSA key 0xBE86EBB415104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF * remotes/berrange/tags/pull-qcrypto-2017-02-27-1: crypto: assert cipher algorithm is always valid crypto: fix leak in ivgen essiv init Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
+2
-6
@@ -63,18 +63,14 @@ static bool mode_need_iv[QCRYPTO_CIPHER_MODE__MAX] = {
|
||||
|
||||
size_t qcrypto_cipher_get_block_len(QCryptoCipherAlgorithm alg)
|
||||
{
|
||||
if (alg >= G_N_ELEMENTS(alg_key_len)) {
|
||||
return 0;
|
||||
}
|
||||
assert(alg < G_N_ELEMENTS(alg_key_len));
|
||||
return alg_block_len[alg];
|
||||
}
|
||||
|
||||
|
||||
size_t qcrypto_cipher_get_key_len(QCryptoCipherAlgorithm alg)
|
||||
{
|
||||
if (alg >= G_N_ELEMENTS(alg_key_len)) {
|
||||
return 0;
|
||||
}
|
||||
assert(alg < G_N_ELEMENTS(alg_key_len));
|
||||
return alg_key_len[alg];
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ static int qcrypto_ivgen_essiv_init(QCryptoIVGen *ivgen,
|
||||
&salt, &nhash,
|
||||
errp) < 0) {
|
||||
g_free(essiv);
|
||||
g_free(salt);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user