MCPcopy Create free account
hub / github.com/ElementsProject/lightning / is_hsm_secret_encrypted

Function is_hsm_secret_encrypted

common/hsm_encryption.c:85–93  ·  view source on GitHub ↗

Returns -1 on error (and sets errno), 0 if not encrypted, 1 if it is */

Source from the content-addressed store, hash-verified

83
84/* Returns -1 on error (and sets errno), 0 if not encrypted, 1 if it is */
85int is_hsm_secret_encrypted(const char *path)
86{
87 struct stat st;
88
89 if (stat(path, &st) != 0)
90 return -1;
91
92 return st.st_size == ENCRYPTED_HSM_SECRET_LEN;
93}
94
95void discard_key(struct secret *key TAKES)
96{

Callers 3

hsm_secret_is_encryptedFunction · 0.85
opt_set_hsm_passwordFunction · 0.85
hsm_initFunction · 0.85

Calls 1

statClass · 0.70

Tested by

no test coverage detected