Documentation
¶
Index ¶
- Constants
- Variables
- func DataSealedKeyUnder(deviceFDEDir string) string
- func FactoryResetFallbackSaveSealedKeyUnder(seedDeviceFDEDir string) string
- func FallbackDataSealedKeyUnder(seedDeviceFDEDir string) string
- func FallbackSaveSealedKeyUnder(seedDeviceFDEDir string) string
- func HasEncryptedMarkerUnder(deviceFDEDir string) bool
- func ReadEncryptionMarkers(dataFDEDir, saveFDEDir string) ([]byte, []byte, error)
- func RecoveryKeyUnder(deviceFDEDir string) string
- func SaveKeyUnder(deviceFDEDir string) string
- func StampSealedKeys(rootdir string, content SealingMethod) error
- func TpmLockoutAuthUnder(saveDeviceFDEDir string) string
- func ValidatePassphraseOrPINEntropy(mode AuthMode, value string) error
- func WriteEncryptionMarkers(dataFDEDir, saveFDEDir string, markerSecret []byte) error
- type AuthMode
- type AuthQualityError
- type AuthQualityErrorReason
- type EncryptionType
- type SealingMethod
- type VolumesAuthOptions
Constants ¶
const ( SealingMethodLegacyTPM = SealingMethod("") SealingMethodTPM = SealingMethod("tpm") SealingMethodFDESetupHook = SealingMethod("fde-setup-hook") )
Variables ¶
var ErrNoSealedKeys = errors.New("no sealed keys")
ErrNoSealedKeys error if there are no sealed keys
Functions ¶
func DataSealedKeyUnder ¶
DataSealedKeyUnder returns the path of the sealed key for ubuntu-data.
func FactoryResetFallbackSaveSealedKeyUnder ¶
FactoryResetFallbackSaveSealedKeyUnder returns the path of a fallback ubuntu save key object generated during factory reset.
func FallbackDataSealedKeyUnder ¶
FallbackDataSealedKeyUnder returns the path of a fallback ubuntu data key.
func FallbackSaveSealedKeyUnder ¶
FallbackSaveSealedKeyUnder returns the path of a fallback ubuntu save key.
func HasEncryptedMarkerUnder ¶
HasEncryptedMarkerUnder returns true when there is an encryption marker in a given directory.
func ReadEncryptionMarkers ¶
ReadEncryptionMarkers reads the encryption marker files at the appropriate locations.
func RecoveryKeyUnder ¶
RecoveryKeyUnder returns the path of the recovery key.
func SaveKeyUnder ¶
SaveKeyUnder returns the path of a plain encryption key for ubuntu-save.
func StampSealedKeys ¶
func StampSealedKeys(rootdir string, content SealingMethod) error
StampSealedKeys writes what sealing method was used for key sealing
func TpmLockoutAuthUnder ¶
TpmLockoutAuthUnder return the path of the tpm lockout authority key.
func ValidatePassphraseOrPINEntropy ¶
ValidatePassphraseOrPINEntropy checks quality of given passphrase or PIN based on their entropy. An AuthQualityError error is returned which contains more information about the given passphrase or PIN quality.
func WriteEncryptionMarkers ¶
WriteEncryptionMarkers writes the encryption marker files at the appropriate locations.
Types ¶
type AuthQualityError ¶
type AuthQualityError struct { // Reasons is a list of reason enums to explain exactly what quality // criteria failed e.g. AuthQualityErrorReasonLowEntropy. Reasons []AuthQualityErrorReason // Entropy is the calculated entropy in bits for the passed passphrase // or PIN. Entropy float64 // MinEntropy is the minimum entropy in bits for the corresponding // authentication mode i.e. passhrase or PIN. MinEntropy float64 // contains filtered or unexported fields }
AuthQualityError contains rich inforamtion on why some auth value did not pass quality checks.
func (*AuthQualityError) Error ¶
func (e *AuthQualityError) Error() string
type AuthQualityErrorReason ¶
type AuthQualityErrorReason string
const (
AuthQualityErrorReasonLowEntropy AuthQualityErrorReason = "low-entropy"
)
type EncryptionType ¶
type EncryptionType string
EncryptionType specifies what encryption backend should be used (if any)
const ( EncryptionTypeNone EncryptionType = "" EncryptionTypeLUKS EncryptionType = "cryptsetup" EncryptionTypeLUKSWithICE EncryptionType = "cryptsetup-with-inline-crypto-engine" )
func (EncryptionType) IsLUKS ¶
func (et EncryptionType) IsLUKS() bool
TODO:ICE: all EncryptionTypes are LUKS based now so this could be removed?
type SealingMethod ¶
type SealingMethod string
SealingMethod represents the sealing method
func SealedKeysMethod ¶
func SealedKeysMethod(rootdir string) (sm SealingMethod, err error)
SealedKeysMethod return whether any keys were sealed at all
type VolumesAuthOptions ¶
type VolumesAuthOptions struct { Mode AuthMode `json:"mode,omitempty"` Passphrase string `json:"passphrase,omitempty"` KDFType string `json:"kdf-type,omitempty"` KDFTime time.Duration `json:"kdf-time,omitempty"` }
VolumesAuthOptions contains options for the volumes authentication mechanism (e.g. passphrase authentication).
TODO: Add PIN option when secboot support lands.
func (*VolumesAuthOptions) Validate ¶
func (o *VolumesAuthOptions) Validate() error
Validates authentication options.