| 1 |
|
| 2 |
# Encrypt directory with --skip-unlock |
| 3 |
|
| 4 |
# => Check dir status |
| 5 |
"MNT/dir" is encrypted with fscrypt. |
| 6 |
|
| 7 |
Policy: desc1 |
| 8 |
Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 |
| 9 |
Unlocked: No |
| 10 |
|
| 11 |
Protected with 1 protector: |
| 12 |
PROTECTOR LINKED DESCRIPTION |
| 13 |
desc2 No custom protector "prot" |
| 14 |
touch: cannot touch 'MNT/dir/file': Required key not available |
| 15 |
|
| 16 |
# => Get policy status via mount: |
| 17 |
desc1 No desc2 |
| 18 |
|
| 19 |
# Unlock directory |
| 20 |
Enter custom passphrase for protector "prot": "MNT/dir" is now unlocked and ready for use. |
| 21 |
|
| 22 |
# => Check dir status |
| 23 |
"MNT/dir" is encrypted with fscrypt. |
| 24 |
|
| 25 |
Policy: desc1 |
| 26 |
Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 |
| 27 |
Unlocked: Yes |
| 28 |
|
| 29 |
Protected with 1 protector: |
| 30 |
PROTECTOR LINKED DESCRIPTION |
| 31 |
desc2 No custom protector "prot" |
| 32 |
|
| 33 |
# => Get policy status via mount: |
| 34 |
desc1 Yes desc2 |
| 35 |
|
| 36 |
# Lock by cycling mount |
| 37 |
|
| 38 |
# => Check dir status |
| 39 |
"MNT/dir" is encrypted with fscrypt. |
| 40 |
|
| 41 |
Policy: desc1 |
| 42 |
Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 |
| 43 |
Unlocked: No |
| 44 |
|
| 45 |
Protected with 1 protector: |
| 46 |
PROTECTOR LINKED DESCRIPTION |
| 47 |
desc2 No custom protector "prot" |
| 48 |
mkdir: cannot create directory 'MNT/dir/subdir': Required key not available |
| 49 |
|
| 50 |
# => Get policy status via mount: |
| 51 |
desc1 No desc2 |
| 52 |
|
| 53 |
# Try to unlock with wrong passphrase |
| 54 |
[ERROR] fscrypt unlock: incorrect key provided |
| 55 |
"MNT/dir" is encrypted with fscrypt. |
| 56 |
|
| 57 |
Policy: desc1 |
| 58 |
Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 |
| 59 |
Unlocked: No |
| 60 |
|
| 61 |
Protected with 1 protector: |
| 62 |
PROTECTOR LINKED DESCRIPTION |
| 63 |
desc2 No custom protector "prot" |
| 64 |
|
| 65 |
# Try to unlock with no stdin |
| 66 |
[ERROR] fscrypt unlock: incorrect key provided |
| 67 |
"MNT/dir" is encrypted with fscrypt. |
| 68 |
|
| 69 |
Policy: desc1 |
| 70 |
Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 |
| 71 |
Unlocked: No |
| 72 |
|
| 73 |
Protected with 1 protector: |
| 74 |
PROTECTOR LINKED DESCRIPTION |
| 75 |
desc2 No custom protector "prot" |
| 76 |
|
| 77 |
# Try to unlock with only a newline |
| 78 |
[ERROR] fscrypt unlock: incorrect key provided |
| 79 |
"MNT/dir" is encrypted with fscrypt. |
| 80 |
|
| 81 |
Policy: desc1 |
| 82 |
Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 |
| 83 |
Unlocked: No |
| 84 |
|
| 85 |
Protected with 1 protector: |
| 86 |
PROTECTOR LINKED DESCRIPTION |
| 87 |
desc2 No custom protector "prot" |
| 88 |
|
| 89 |
# Unlock directory |
| 90 |
Enter custom passphrase for protector "prot": "MNT/dir" is now unlocked and ready for use. |
| 91 |
|
| 92 |
# => Check dir status |
| 93 |
"MNT/dir" is encrypted with fscrypt. |
| 94 |
|
| 95 |
Policy: desc1 |
| 96 |
Options: padding:32 contents:AES_256_XTS filenames:AES_256_CTS policy_version:2 |
| 97 |
Unlocked: Yes |
| 98 |
|
| 99 |
Protected with 1 protector: |
| 100 |
PROTECTOR LINKED DESCRIPTION |
| 101 |
desc2 No custom protector "prot" |
| 102 |
contents |
| 103 |
|
| 104 |
# => Get policy status via mount: |
| 105 |
desc1 Yes desc2 |
| 106 |
|
| 107 |
# Try to unlock with corrupt policy metadata |
| 108 |
[ERROR] fscrypt unlock: fscrypt metadata file at |
| 109 |
"MNT/.fscrypt/policies/desc1" |
| 110 |
is corrupt: proto: cannot parse invalid wire-format data |
| 111 |
|
| 112 |
# Try to unlock with missing policy metadata |
| 113 |
[ERROR] fscrypt unlock: filesystem "MNT" does not contain |
| 114 |
the policy metadata for "MNT/dir". |
| 115 |
This directory has either been encrypted with another |
| 116 |
tool (such as e4crypt), or the file |
| 117 |
"MNT/.fscrypt/policies/desc24" |
| 118 |
has been deleted. |
| 119 |
|
| 120 |
# Try to unlock with missing protector metadata |
| 121 |
[ERROR] fscrypt unlock: could not load any protectors |
| 122 |
|
| 123 |
You may need to mount a linked filesystem. Run with --verbose for more |
| 124 |
information. |
| 125 |
|
| 126 |
# Try to unlock with wrong policy metadata |
| 127 |
[ERROR] fscrypt unlock: inconsistent metadata between encrypted directory |
| 128 |
"MNT/dir1" and its corresponding |
| 129 |
metadata file |
| 130 |
"MNT/.fscrypt/policies/desc25". |
| 131 |
|
| 132 |
Directory has |
| 133 |
descriptor:desc25 padding:32 |
| 134 |
contents:AES_256_XTS filenames:AES_256_CTS |
| 135 |
policy_version:2 |
| 136 |
|
| 137 |
Metadata file has |
| 138 |
descriptor:desc27 padding:32 |
| 139 |
contents:AES_256_XTS filenames:AES_256_CTS |
| 140 |
policy_version:2 |