Marc-André Lureau | 5582c58 | 2019-07-16 19:28:54 +0400 | [diff] [blame] | 1 | crypto_ss = ss.source_set() |
| 2 | crypto_ss.add(genh) |
| 3 | crypto_ss.add(files( |
| 4 | 'afsplit.c', |
| 5 | 'block-luks.c', |
| 6 | 'block-qcow.c', |
| 7 | 'block.c', |
| 8 | 'cipher.c', |
| 9 | 'desrfb.c', |
| 10 | 'hash.c', |
| 11 | 'hmac.c', |
| 12 | 'ivgen-essiv.c', |
| 13 | 'ivgen-plain.c', |
| 14 | 'ivgen-plain64.c', |
| 15 | 'ivgen.c', |
| 16 | 'pbkdf.c', |
| 17 | 'secret_common.c', |
| 18 | 'secret.c', |
| 19 | 'tlscreds.c', |
| 20 | 'tlscredsanon.c', |
| 21 | 'tlscredspsk.c', |
| 22 | 'tlscredsx509.c', |
| 23 | 'tlssession.c', |
| 24 | )) |
| 25 | |
| 26 | if 'CONFIG_GCRYPT' in config_host |
| 27 | wo_nettle = files('hash-gcrypt.c', 'pbkdf-gcrypt.c') |
| 28 | else |
| 29 | wo_nettle = files('hash-glib.c', 'pbkdf-stub.c') |
| 30 | endif |
| 31 | if 'CONFIG_GCRYPT_HMAC' not in config_host |
| 32 | wo_nettle += files('hmac-glib.c') |
| 33 | endif |
| 34 | crypto_ss.add(when: [nettle, 'CONFIG_NETTLE'], |
| 35 | if_true: files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'), |
| 36 | if_false: wo_nettle) |
| 37 | |
| 38 | crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c')) |
| 39 | crypto_ss.add(when: 'CONFIG_QEMU_PRIVATE_XTS', if_true: files('xts.c')) |
| 40 | crypto_ss.add(when: 'CONFIG_GCRYPT_HMAC', if_true: files('hmac-gcrypt.c')) |
| 41 | crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c')) |
| 42 | crypto_ss.add(when: 'CONFIG_GNUTLS', if_true: files('tls-cipher-suites.c')) |
| 43 | |
| 44 | crypto_ss = crypto_ss.apply(config_host, strict: false) |
| 45 | libcrypto = static_library('crypto', crypto_ss.sources() + genh, |
| 46 | dependencies: [crypto_ss.dependencies()], |
| 47 | name_suffix: 'fa', |
| 48 | build_by_default: false) |
| 49 | |
| 50 | crypto = declare_dependency(link_whole: libcrypto, |
| 51 | dependencies: [authz, qom]) |
| 52 | |
Paolo Bonzini | a81df1b | 2020-08-19 08:44:56 -0400 | [diff] [blame] | 53 | util_ss.add(files('aes.c')) |
| 54 | util_ss.add(files('init.c')) |
| 55 | if 'CONFIG_GCRYPT' in config_host |
| 56 | util_ss.add(files('random-gcrypt.c')) |
| 57 | elif 'CONFIG_GNUTLS' in config_host |
| 58 | util_ss.add(files('random-gnutls.c'), gnutls) |
| 59 | elif 'CONFIG_RNG_NONE' in config_host |
| 60 | util_ss.add(files('random-none.c')) |
| 61 | else |
| 62 | util_ss.add(files('random-platform.c')) |
| 63 | endif |