diff options
author | Sean Bruno <sbruno@freebsd.org> | 2014-06-16 08:02:07 -0700 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-06-19 16:13:38 +0100 |
commit | 9f6f7f1a85b118ba129620e12bd423a135c8f231 (patch) | |
tree | b0fa3977229b0cc8007ab5a2bdf324d180e760e1 /include/qemu/aes.h | |
parent | e637aa66470b4a9cdfc39c88090c5e19e4a50e6e (diff) | |
download | hqemu-9f6f7f1a85b118ba129620e12bd423a135c8f231.zip hqemu-9f6f7f1a85b118ba129620e12bd423a135c8f231.tar.gz |
include/qemu/aes.h: Avoid conflicts with FreeBSD AES functions
FreeBSD's libcrypto provides functions with the same names as us;
use #define to rename our versions to avoid conflicts at link time.
Signed-off-by: Sean Bruno <sbruno@freebsd.org>
Signed-off-by: Ed Maste <emaste@freebsd.org>
Message-id: 1402930927-41125-1-git-send-email-sbruno@freebsd.org
[PMM: improved commit message, fixed comment typo]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/qemu/aes.h')
-rw-r--r-- | include/qemu/aes.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/qemu/aes.h b/include/qemu/aes.h index c106660..a006da2 100644 --- a/include/qemu/aes.h +++ b/include/qemu/aes.h @@ -10,6 +10,15 @@ struct aes_key_st { }; typedef struct aes_key_st AES_KEY; +/* FreeBSD has its own AES_set_decrypt_key in -lcrypto, avoid conflicts */ +#ifdef __FreeBSD__ +#define AES_set_encrypt_key QEMU_AES_set_encrypt_key +#define AES_set_decrypt_key QEMU_AES_set_decrypt_key +#define AES_encrypt QEMU_AES_encrypt +#define AES_decrypt QEMU_AES_decrypt +#define AES_cbc_encrypt QEMU_AES_cbc_encrypt +#endif + int AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); int AES_set_decrypt_key(const unsigned char *userKey, const int bits, |