have and cc.has_function('crypt_set_metadata_size', dependencies : libcryptsetup))
conf.set10('HAVE_CRYPT_ACTIVATE_BY_SIGNED_KEY',
have and cc.has_function('crypt_activate_by_signed_key', dependencies : libcryptsetup))
+ conf.set10('HAVE_CRYPT_TOKEN_MAX',
+ have and cc.has_function('crypt_token_max', dependencies : libcryptsetup))
else
have = false
libcryptsetup = []
endif
conf.set10('HAVE_LIBFIDO2', have)
+want_tpm2 = get_option('tpm2')
+if want_tpm2 != 'false' and not skip_deps
+ tpm2 = dependency('tss2-esys tss2-rc tss2-mu',
+ required : want_tpm2 == 'true')
+ have = tpm2.found()
+else
+ have = false
+ tpm2 = []
+endif
+conf.set10('HAVE_TPM2', have)
+
want_elfutils = get_option('elfutils')
if want_elfutils != 'false' and not skip_deps
libdw = dependency('libdw',
libcrypt,
libopenssl,
libfdisk,
- libp11kit,
- libfido2],
+ libp11kit],
install_rpath : rootlibexecdir,
install : true,
install_dir : rootlibexecdir)
libcrypt,
libopenssl,
libp11kit,
- libfido2,
libdl],
install_rpath : rootlibexecdir,
install : true,
if conf.get('HAVE_LIBCRYPTSETUP') == 1
systemd_cryptsetup_sources = files('''
- src/cryptsetup/cryptsetup-pkcs11.h
+ src/cryptsetup/cryptsetup-fido2.h
src/cryptsetup/cryptsetup-keyfile.c
src/cryptsetup/cryptsetup-keyfile.h
+ src/cryptsetup/cryptsetup-pkcs11.h
+ src/cryptsetup/cryptsetup-tpm2.h
src/cryptsetup/cryptsetup.c
'''.split())
systemd_cryptsetup_sources += files('src/cryptsetup/cryptsetup-pkcs11.c')
endif
+ if conf.get('HAVE_LIBFIDO2') == 1
+ systemd_cryptsetup_sources += files('src/cryptsetup/cryptsetup-fido2.c')
+ endif
+
+ if conf.get('HAVE_TPM2') == 1
+ systemd_cryptsetup_sources += files('src/cryptsetup/cryptsetup-tpm2.c')
+ endif
+
executable(
'systemd-cryptsetup',
systemd_cryptsetup_sources,
install_rpath : rootlibexecdir,
install : true,
install_dir : systemgeneratordir)
+
+ systemd_cryptenroll_sources = files('''
+ src/cryptenroll/cryptenroll-fido2.h
+ src/cryptenroll/cryptenroll-list.c
+ src/cryptenroll/cryptenroll-list.h
+ src/cryptenroll/cryptenroll-password.c
+ src/cryptenroll/cryptenroll-password.h
+ src/cryptenroll/cryptenroll-pkcs11.h
+ src/cryptenroll/cryptenroll-recovery.c
+ src/cryptenroll/cryptenroll-recovery.h
+ src/cryptenroll/cryptenroll-tpm2.h
+ src/cryptenroll/cryptenroll-wipe.c
+ src/cryptenroll/cryptenroll-wipe.h
+ src/cryptenroll/cryptenroll.c
+ src/cryptenroll/cryptenroll.h
+'''.split())
+
+ if conf.get('HAVE_P11KIT') == 1 and conf.get('HAVE_OPENSSL') == 1
+ systemd_cryptenroll_sources += files('src/cryptenroll/cryptenroll-pkcs11.c')
+ endif
+
+ if conf.get('HAVE_LIBFIDO2') == 1
+ systemd_cryptenroll_sources += files('src/cryptenroll/cryptenroll-fido2.c')
+ endif
+
+ if conf.get('HAVE_TPM2') == 1
+ systemd_cryptenroll_sources += files('src/cryptenroll/cryptenroll-tpm2.c')
+ endif
+
+ executable(
+ 'systemd-cryptenroll',
+ systemd_cryptenroll_sources,
+ include_directories : includes,
+ link_with : [libshared],
+ dependencies : [libcryptsetup,
+ libdl,
+ libopenssl,
+ libp11kit],
+ install_rpath : rootlibexecdir,
+ install : true,
+ install_dir : bindir)
endif
if conf.get('HAVE_SYSV_COMPAT') == 1
if git.found()
all_files = run_command(
+ 'env', '-u', 'GIT_WORK_TREE',
git,
- ['--git-dir=@0@/.git'.format(project_source_root),
- 'ls-files',
- ':/*.[ch]'])
+ '--git-dir=@0@/.git'.format(project_source_root),
+ 'ls-files', ':/*.[ch]')
+
all_files = files(all_files.stdout().split())
custom_target(
['libfdisk'],
['p11kit'],
['libfido2'],
+ ['tpm2'],
['AUDIT'],
['IMA'],
['AppArmor'],