diff options
Diffstat (limited to 'fs/ecryptfs/keystore.c')
-rw-r--r-- | fs/ecryptfs/keystore.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index a6cbfc16d8a4..09e2340ab783 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c | |||
@@ -39,7 +39,7 @@ | |||
39 | * determine the type of error, make appropriate log entries, and | 39 | * determine the type of error, make appropriate log entries, and |
40 | * return an error code. | 40 | * return an error code. |
41 | */ | 41 | */ |
42 | int process_request_key_err(long err_code) | 42 | static int process_request_key_err(long err_code) |
43 | { | 43 | { |
44 | int rc = 0; | 44 | int rc = 0; |
45 | 45 | ||
@@ -396,6 +396,27 @@ out: | |||
396 | return rc; | 396 | return rc; |
397 | } | 397 | } |
398 | 398 | ||
399 | static int | ||
400 | ecryptfs_get_auth_tok_sig(char **sig, struct ecryptfs_auth_tok *auth_tok) | ||
401 | { | ||
402 | int rc = 0; | ||
403 | |||
404 | (*sig) = NULL; | ||
405 | switch (auth_tok->token_type) { | ||
406 | case ECRYPTFS_PASSWORD: | ||
407 | (*sig) = auth_tok->token.password.signature; | ||
408 | break; | ||
409 | case ECRYPTFS_PRIVATE_KEY: | ||
410 | (*sig) = auth_tok->token.private_key.signature; | ||
411 | break; | ||
412 | default: | ||
413 | printk(KERN_ERR "Cannot get sig for auth_tok of type [%d]\n", | ||
414 | auth_tok->token_type); | ||
415 | rc = -EINVAL; | ||
416 | } | ||
417 | return rc; | ||
418 | } | ||
419 | |||
399 | /** | 420 | /** |
400 | * decrypt_pki_encrypted_session_key - Decrypt the session key with the given auth_tok. | 421 | * decrypt_pki_encrypted_session_key - Decrypt the session key with the given auth_tok. |
401 | * @auth_tok: The key authentication token used to decrypt the session key | 422 | * @auth_tok: The key authentication token used to decrypt the session key |
@@ -1082,26 +1103,6 @@ out: | |||
1082 | return rc; | 1103 | return rc; |
1083 | } | 1104 | } |
1084 | 1105 | ||
1085 | int ecryptfs_get_auth_tok_sig(char **sig, struct ecryptfs_auth_tok *auth_tok) | ||
1086 | { | ||
1087 | int rc = 0; | ||
1088 | |||
1089 | (*sig) = NULL; | ||
1090 | switch (auth_tok->token_type) { | ||
1091 | case ECRYPTFS_PASSWORD: | ||
1092 | (*sig) = auth_tok->token.password.signature; | ||
1093 | break; | ||
1094 | case ECRYPTFS_PRIVATE_KEY: | ||
1095 | (*sig) = auth_tok->token.private_key.signature; | ||
1096 | break; | ||
1097 | default: | ||
1098 | printk(KERN_ERR "Cannot get sig for auth_tok of type [%d]\n", | ||
1099 | auth_tok->token_type); | ||
1100 | rc = -EINVAL; | ||
1101 | } | ||
1102 | return rc; | ||
1103 | } | ||
1104 | |||
1105 | /** | 1106 | /** |
1106 | * ecryptfs_parse_packet_set | 1107 | * ecryptfs_parse_packet_set |
1107 | * @crypt_stat: The cryptographic context | 1108 | * @crypt_stat: The cryptographic context |