diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2019-08-22 17:57:09 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-08-22 17:57:09 +0100 |
commit | 3590b27c7a2be7a24b4b265e2e9458b3761103e1 (patch) | |
tree | c4f94fe22dc14be0929494f0c9688ab4a84c65fd /include/crypto | |
parent | d013d220c710054a6d755941460f88c186fef7b5 (diff) | |
parent | 57b9f113fce2a2231a47e9295c1d461e9ff7f0f7 (diff) | |
download | qemu-3590b27c7a2be7a24b4b265e2e9458b3761103e1.zip qemu-3590b27c7a2be7a24b4b265e2e9458b3761103e1.tar.gz qemu-3590b27c7a2be7a24b4b265e2e9458b3761103e1.tar.bz2 |
Merge remote-tracking branch 'remotes/berrange/tags/autofree-pull-request' into staging
require newer glib2 to enable autofree'ing of stack variables exiting scope
* Bump minium glib2 version to 2.48
* Convert much of the crypto code to use automatic memory free functions
# gpg: Signature made Thu 22 Aug 2019 11:51:59 BST
# gpg: using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg: aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF
* remotes/berrange/tags/autofree-pull-request:
crypto: use auto cleanup for many stack variables
crypto: define cleanup functions for use with g_autoptr
glib: bump min required glib library version to 2.48
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/block.h | 2 | ||||
-rw-r--r-- | include/crypto/cipher.h | 2 | ||||
-rw-r--r-- | include/crypto/hmac.h | 2 | ||||
-rw-r--r-- | include/crypto/ivgen.h | 2 | ||||
-rw-r--r-- | include/crypto/tlssession.h | 2 |
5 files changed, 10 insertions, 0 deletions
diff --git a/include/crypto/block.h b/include/crypto/block.h index fe12899..d49d2c2 100644 --- a/include/crypto/block.h +++ b/include/crypto/block.h @@ -268,4 +268,6 @@ uint64_t qcrypto_block_get_sector_size(QCryptoBlock *block); */ void qcrypto_block_free(QCryptoBlock *block); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoBlock, qcrypto_block_free) + #endif /* QCRYPTO_BLOCK_H */ diff --git a/include/crypto/cipher.h b/include/crypto/cipher.h index cac90b4..5928e5e 100644 --- a/include/crypto/cipher.h +++ b/include/crypto/cipher.h @@ -170,6 +170,8 @@ QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg, */ void qcrypto_cipher_free(QCryptoCipher *cipher); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoCipher, qcrypto_cipher_free) + /** * qcrypto_cipher_encrypt: * @cipher: the cipher object diff --git a/include/crypto/hmac.h b/include/crypto/hmac.h index aa3c97a..ad4d778 100644 --- a/include/crypto/hmac.h +++ b/include/crypto/hmac.h @@ -65,6 +65,8 @@ QCryptoHmac *qcrypto_hmac_new(QCryptoHashAlgorithm alg, */ void qcrypto_hmac_free(QCryptoHmac *hmac); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoHmac, qcrypto_hmac_free) + /** * qcrypto_hmac_bytesv: * @hmac: the hmac object diff --git a/include/crypto/ivgen.h b/include/crypto/ivgen.h index 9b4a62f..e415215 100644 --- a/include/crypto/ivgen.h +++ b/include/crypto/ivgen.h @@ -203,4 +203,6 @@ QCryptoHashAlgorithm qcrypto_ivgen_get_hash(QCryptoIVGen *ivgen); */ void qcrypto_ivgen_free(QCryptoIVGen *ivgen); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoIVGen, qcrypto_ivgen_free) + #endif /* QCRYPTO_IVGEN_H */ diff --git a/include/crypto/tlssession.h b/include/crypto/tlssession.h index 816300c..e01e1a9 100644 --- a/include/crypto/tlssession.h +++ b/include/crypto/tlssession.h @@ -160,6 +160,8 @@ QCryptoTLSSession *qcrypto_tls_session_new(QCryptoTLSCreds *creds, */ void qcrypto_tls_session_free(QCryptoTLSSession *sess); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(QCryptoTLSSession, qcrypto_tls_session_free) + /** * qcrypto_tls_session_check_credentials: * @sess: the TLS session object |