Documentation ¶
Overview ¶
Package hwsec contains local Tast tests that exercise TPM-related daemons.
See details of each daemon at the following locations:
https://chromium.googlesource.com/chromiumos/platform2/+/main/attestation https://chromium.googlesource.com/chromiumos/platform2/+/main/chaps https://chromium.googlesource.com/chromiumos/platform2/+/main/cryptohome https://chromium.googlesource.com/chromiumos/platform2/+/main/tpm_manager https://chromium.googlesource.com/chromiumos/platform2/+/main/trunks https://chromium.googlesource.com/chromiumos/platform2/+/main/u2fd
Index ¶
- func AccountDiskUsage(ctx context.Context, s *testing.State)
- func Attestation(ctx context.Context, s *testing.State)
- func AttestationEID(ctx context.Context, s *testing.State)
- func AttestationEnrollOnly(ctx context.Context, s *testing.State)
- func AttestationNoExternalServer(ctx context.Context, s *testing.State)
- func CertProvision(ctx context.Context, s *testing.State)
- func CertProvisionNoDatabase(ctx context.Context, s *testing.State)
- func ChallengeResponseMount(ctx context.Context, s *testing.State)
- func ChapsAttributePolicy(ctx context.Context, s *testing.State)
- func ChapsCloseAllSessions(ctx context.Context, s *testing.State)
- func ChapsECDSA(ctx context.Context, s *testing.State)
- func ChapsECPerf(ctx context.Context, s *testing.State)
- func ChapsPKCS1V15(ctx context.Context, s *testing.State)
- func ChapsPerf(ctx context.Context, s *testing.State)
- func ChapsRSAPSS(ctx context.Context, s *testing.State)
- func ChapsRemount(ctx context.Context, s *testing.State)
- func CrossVersionLogin(ctx context.Context, s *testing.State)
- func CryptohomeBadPerms(ctx context.Context, s *testing.State)
- func CryptohomeCorruptedKeys(ctx context.Context, s *testing.State)
- func CryptohomeDataLeak(ctx context.Context, s *testing.State)
- func CryptohomeKeyEviction(ctx context.Context, s *testing.State)
- func CryptohomeMigrateKey(ctx context.Context, s *testing.State)
- func CryptohomeMount(ctx context.Context, s *testing.State)
- func CryptohomeNonDirs(ctx context.Context, s *testing.State)
- func CryptohomeTestAuth(ctx context.Context, s *testing.State)
- func DaemonsRestartStress(ctx context.Context, s *testing.State)
- func DictionaryAttackLockoutResetTPM1(ctx context.Context, s *testing.State)
- func DictionaryAttackLockoutResetTPM2(ctx context.Context, s *testing.State)
- func ECDHShortKey(ctx context.Context, s *testing.State)
- func FirmwareManagementParameters(ctx context.Context, s *testing.State)
- func KeysetTiedToTPM2(ctx context.Context, s *testing.State)
- func Login(ctx context.Context, s *testing.State)
- func LoginGuest(ctx context.Context, s *testing.State)
- func MountCombinations(ctx context.Context, s *testing.State)
- func Pkcs11ChangeAuthData(ctx context.Context, s *testing.State)
- func Pkcs11Events(ctx context.Context, s *testing.State)
- func Pkcs11InitOnLogin(ctx context.Context, s *testing.State)
- func Pkcs11InitUnderErrors(ctx context.Context, s *testing.State)
- func Pkcs11LoadPerf(ctx context.Context, s *testing.State)
- func PrepareCrossVersionLoginData(ctx context.Context, s *testing.State)
- func RecreateUserVaultTPM2(ctx context.Context, s *testing.State)
- func SanitizedUsernameAndSalt(ctx context.Context, s *testing.State)
- func UnmountAll(ctx context.Context, s *testing.State)
- type AttestationDBusService
- func (*AttestationDBusService) CreateCertificateRequest(ctx context.Context, request *apb.CreateCertificateRequestRequest) (*apb.CreateCertificateRequestReply, error)
- func (*AttestationDBusService) CreateEnrollRequest(ctx context.Context, request *apb.CreateEnrollRequestRequest) (*apb.CreateEnrollRequestReply, error)
- func (*AttestationDBusService) DeleteKeys(ctx context.Context, request *apb.DeleteKeysRequest) (*apb.DeleteKeysReply, error)
- func (*AttestationDBusService) FinishCertificateRequest(ctx context.Context, request *apb.FinishCertificateRequestRequest) (*apb.FinishCertificateRequestReply, error)
- func (*AttestationDBusService) FinishEnroll(ctx context.Context, request *apb.FinishEnrollRequest) (*apb.FinishEnrollReply, error)
- func (*AttestationDBusService) GetEnrollmentID(ctx context.Context, request *apb.GetEnrollmentIdRequest) (*apb.GetEnrollmentIdReply, error)
- func (*AttestationDBusService) GetKeyInfo(ctx context.Context, request *apb.GetKeyInfoRequest) (*apb.GetKeyInfoReply, error)
- func (*AttestationDBusService) GetStatus(ctx context.Context, request *apb.GetStatusRequest) (*apb.GetStatusReply, error)
- func (*AttestationDBusService) RegisterKeyWithChapsToken(ctx context.Context, request *apb.RegisterKeyWithChapsTokenRequest) (*apb.RegisterKeyWithChapsTokenReply, error)
- func (*AttestationDBusService) SetKeyPayload(ctx context.Context, request *apb.SetKeyPayloadRequest) (*apb.SetKeyPayloadReply, error)
- func (*AttestationDBusService) SignEnterpriseChallenge(ctx context.Context, request *apb.SignEnterpriseChallengeRequest) (*apb.SignEnterpriseChallengeReply, error)
- func (*AttestationDBusService) SignSimpleChallenge(ctx context.Context, request *apb.SignSimpleChallengeRequest) (*apb.SignSimpleChallengeReply, error)
- type OwnershipService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Attestation ¶
Attestation runs through the attestation flow, including enrollment, cert, sign challenge. Also, it verifies the the key access functionality.
func AttestationEnrollOnly ¶
AttestationEnrollOnly enrolls the device. Note that this item it to check if crbug/1070162 can be reproduced.
func AttestationNoExternalServer ¶
AttestationNoExternalServer runs through the attestation flow, including enrollment, cert, sign challenge. Also, it verifies the the key access functionality. All the external dependencies are replaced with the locally generated server responses.
func ChapsCloseAllSessions ¶
ChapsCloseAllSessions verifies the behaviour of C_CloseAllSessions() in libchaps is correct.
func CryptohomeBadPerms ¶
CryptohomeBadPerms checks that cryptohome could detect directories with bad permissions or ownership in the mount path of a home directory.
func CryptohomeCorruptedKeys ¶
CryptohomeCorruptedKeys checks that the mount and keys works when part of the vaultkeys corrupted.
func CryptohomeKeyEviction ¶
CryptohomeKeyEviction ensures that the cryptohome properly manages key eviction from the tpm. This test verifies this behaviour by creating 30 keys using chaps, and then remounting a user's cryptohome. Mount requires use of the user's cryptohome key, and thus the mount only succeeds if the cryptohome key was properly evicted and reloaded into the TPM.
func CryptohomeMigrateKey ¶
CryptohomeMigrateKey checks that cryptohome could migrate the key and login correctly.
func CryptohomeMount ¶
CryptohomeMount checks that cryptohome could mount the user folder correctly.
func CryptohomeNonDirs ¶
CryptohomeNonDirs checks that cryptohome could detect directories with bad permissions or ownership in the mount path of a home directory.
func CryptohomeTestAuth ¶
CryptohomeTestAuth checks that cryptohome could test the user authorization correctly.
func DaemonsRestartStress ¶
DaemonsRestartStress checks that restarting hwsec daemons wouldn't cause problems.
func DictionaryAttackLockoutResetTPM1 ¶
DictionaryAttackLockoutResetTPM1 checks that get dictionary attack info and reset dictionary attack lockout works as expected.
func DictionaryAttackLockoutResetTPM2 ¶
DictionaryAttackLockoutResetTPM2 checks that get dictionary attack info and reset dictionary attack lockout works as expected.
func ECDHShortKey ¶
ECDHShortKey verifies ECDD can work with short ECC keys.
func FirmwareManagementParameters ¶
FirmwareManagementParameters checks that the firmware management parameters are functioning correctly.
func KeysetTiedToTPM2 ¶
KeysetTiedToTPM2 is an integration test that verifies a user's VKK is tied to the TPM after the second login.
func MountCombinations ¶
MountCombinations tests that we are able to signin/mount 2+ users with different combinations of pin/password.
func Pkcs11ChangeAuthData ¶
Pkcs11ChangeAuthData test the chapsd behavior of change auth data.
func Pkcs11Events ¶
Pkcs11Events test the response of the PKCS #11 system to load /unload events.
func Pkcs11InitOnLogin ¶
Pkcs11InitOnLogin test the PKCS#11 behavior of initialization on login.
func Pkcs11InitUnderErrors ¶
Pkcs11InitUnderErrors test the chapsd pkcs11 initialization under various system states.
func Pkcs11LoadPerf ¶
Pkcs11LoadPerf test the chapsd load key performance.
func RecreateUserVaultTPM2 ¶
RecreateUserVaultTPM2 is ported from the autotest test platform_CryptohomeTPMReOwn and renamed to reflects what's being tested. It avoids reboots in the original test by using the soft-clearing TPM utils and restarting TPM-related daemons.
Types ¶
type AttestationDBusService ¶
type AttestationDBusService struct {
// contains filtered or unexported fields
}
func (*AttestationDBusService) CreateCertificateRequest ¶
func (*AttestationDBusService) CreateCertificateRequest(ctx context.Context, request *apb.CreateCertificateRequestRequest) (*apb.CreateCertificateRequestReply, error)
func (*AttestationDBusService) CreateEnrollRequest ¶
func (*AttestationDBusService) CreateEnrollRequest(ctx context.Context, request *apb.CreateEnrollRequestRequest) (*apb.CreateEnrollRequestReply, error)
func (*AttestationDBusService) DeleteKeys ¶
func (*AttestationDBusService) DeleteKeys(ctx context.Context, request *apb.DeleteKeysRequest) (*apb.DeleteKeysReply, error)
func (*AttestationDBusService) FinishCertificateRequest ¶
func (*AttestationDBusService) FinishCertificateRequest(ctx context.Context, request *apb.FinishCertificateRequestRequest) (*apb.FinishCertificateRequestReply, error)
func (*AttestationDBusService) FinishEnroll ¶
func (*AttestationDBusService) FinishEnroll(ctx context.Context, request *apb.FinishEnrollRequest) (*apb.FinishEnrollReply, error)
func (*AttestationDBusService) GetEnrollmentID ¶
func (*AttestationDBusService) GetEnrollmentID(ctx context.Context, request *apb.GetEnrollmentIdRequest) (*apb.GetEnrollmentIdReply, error)
func (*AttestationDBusService) GetKeyInfo ¶
func (*AttestationDBusService) GetKeyInfo(ctx context.Context, request *apb.GetKeyInfoRequest) (*apb.GetKeyInfoReply, error)
func (*AttestationDBusService) GetStatus ¶
func (*AttestationDBusService) GetStatus(ctx context.Context, request *apb.GetStatusRequest) (*apb.GetStatusReply, error)
func (*AttestationDBusService) RegisterKeyWithChapsToken ¶
func (*AttestationDBusService) RegisterKeyWithChapsToken(ctx context.Context, request *apb.RegisterKeyWithChapsTokenRequest) (*apb.RegisterKeyWithChapsTokenReply, error)
func (*AttestationDBusService) SetKeyPayload ¶
func (*AttestationDBusService) SetKeyPayload(ctx context.Context, request *apb.SetKeyPayloadRequest) (*apb.SetKeyPayloadReply, error)
func (*AttestationDBusService) SignEnterpriseChallenge ¶
func (*AttestationDBusService) SignEnterpriseChallenge(ctx context.Context, request *apb.SignEnterpriseChallengeRequest) (*apb.SignEnterpriseChallengeReply, error)
func (*AttestationDBusService) SignSimpleChallenge ¶
func (*AttestationDBusService) SignSimpleChallenge(ctx context.Context, request *apb.SignSimpleChallengeRequest) (*apb.SignSimpleChallengeReply, error)
type OwnershipService ¶
type OwnershipService struct {
// contains filtered or unexported fields
}
func (*OwnershipService) EnsureTPMAndSystemStateAreReset ¶
func (*OwnershipService) EnsureTPMAndSystemStateAreReset(ctx context.Context, req *empty.Empty) (*empty.Empty, error)
EnsureTPMAndSystemStateAreReset calls the local EnsureTPMAndSystemStateAreReset hwsec helpers.
func (*OwnershipService) EnsureTPMIsReset ¶
func (*OwnershipService) EnsureTPMIsReset(ctx context.Context, req *empty.Empty) (*empty.Empty, error)
EnsureTPMIsReset calls the local EnsureTPMIsReset hwsec helpers.
Source Files ¶
- account_disk_usage.go
- attestation.go
- attestation_dbus_service.go
- attestation_eid.go
- attestation_enroll_only.go
- attestation_no_external_server.go
- cert_provision.go
- cert_provision_no_database.go
- challenge_response_mount.go
- chaps_attribute_policy.go
- chaps_close_all_sessions.go
- chaps_ec_perf.go
- chaps_ecdsa.go
- chaps_perf.go
- chaps_pkcs1v15.go
- chaps_remount.go
- chaps_rsapss.go
- cross_version_login.go
- cryptohome_bad_perms.go
- cryptohome_corrupted_keys.go
- cryptohome_data_leak.go
- cryptohome_key_eviction.go
- cryptohome_migrate_key.go
- cryptohome_mount.go
- cryptohome_non_dirs.go
- cryptohome_test_auth.go
- daemons_restart_stress.go
- dictionary_attack_lockout_reset_tpm1.go
- dictionary_attack_lockout_reset_tpm2.go
- doc.go
- ecdh_short_key.go
- firmware_management_parameters.go
- keyset_tied_to_tpm2.go
- login.go
- login_guest.go
- mount_combinations.go
- ownership_service.go
- pkcs11_change_auth_data.go
- pkcs11_events.go
- pkcs11_init_on_login.go
- pkcs11_init_under_errors.go
- pkcs11_load_perf.go
- prepare_cross_version_login_data.go
- recreate_user_vault_tpm2.go
- sanitized_username_and_salt.go
- unmount_all.go