diff options
author | Michael Halcrow <mhalcrow@us.ibm.com> | 2007-10-16 04:28:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:11 -0400 |
commit | 22e78fafbdf84883f70eb4944cf658fc23c4a1f4 (patch) | |
tree | 1b922f289e05f01d5c8d02427617cdb9bd66707c /fs/ecryptfs/keystore.c | |
parent | 6c6f57f3bee1e3c3d31b08a0161c435bfaeb77eb (diff) |
eCryptfs: kerneldoc fixes for crypto.c and keystore.c
Andrew Morton wrote:
From: mhalcrow@us.ibm.com <mhalcrow@halcrow.austin.ibm.com>
> > +/**
> > + * decrypt_passphrase_encrypted_session_key - Decrypt the session key
> > + * with the given auth_tok.
> > *
> > * Returns Zero on success; non-zero error otherwise.
> > */
>
> That comment purports to be a kerneldoc-style comment. But
>
> - kerneldoc doesn't support multiple lines on the introductory line
> which identifies the name of the function (alas). So you'll need to
> overflow 80 cols here.
>
> - the function args weren't documented
>
> But the return value is! People regularly forget to do that. And
> they frequently forget to document the locking prerequisites and the
> permissible calling contexts (process/might_sleep/hardirq, etc)
>
> (please check all ecryptfs kerneldoc for this stuff sometime)
This patch cleans up some of the existing comments and makes a couple
of line break tweaks. There is more work to do to bring eCryptfs into
full kerneldoc-compliance.
Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs/keystore.c')
-rw-r--r-- | fs/ecryptfs/keystore.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index 778bdf9e0502..e9cda7afe6be 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c | |||
@@ -71,7 +71,7 @@ int process_request_key_err(long err_code) | |||
71 | * address; zero on error | 71 | * address; zero on error |
72 | * @length_size: The number of bytes occupied by the encoded length | 72 | * @length_size: The number of bytes occupied by the encoded length |
73 | * | 73 | * |
74 | * Returns Zero on success | 74 | * Returns zero on success; non-zero on error |
75 | */ | 75 | */ |
76 | static int parse_packet_length(unsigned char *data, size_t *size, | 76 | static int parse_packet_length(unsigned char *data, size_t *size, |
77 | size_t *length_size) | 77 | size_t *length_size) |
@@ -106,11 +106,11 @@ out: | |||
106 | 106 | ||
107 | /** | 107 | /** |
108 | * write_packet_length | 108 | * write_packet_length |
109 | * @dest: The byte array target into which to write the | 109 | * @dest: The byte array target into which to write the length. Must |
110 | * length. Must have at least 5 bytes allocated. | 110 | * have at least 5 bytes allocated. |
111 | * @size: The length to write. | 111 | * @size: The length to write. |
112 | * @packet_size_length: The number of bytes used to encode the | 112 | * @packet_size_length: The number of bytes used to encode the packet |
113 | * packet length is written to this address. | 113 | * length is written to this address. |
114 | * | 114 | * |
115 | * Returns zero on success; non-zero on error. | 115 | * Returns zero on success; non-zero on error. |
116 | */ | 116 | */ |
@@ -397,10 +397,11 @@ out: | |||
397 | } | 397 | } |
398 | 398 | ||
399 | /** | 399 | /** |
400 | * decrypt_pki_encrypted_session_key - Decrypt the session key with | 400 | * decrypt_pki_encrypted_session_key - Decrypt the session key with the given auth_tok. |
401 | * the given auth_tok. | 401 | * @auth_tok: The key authentication token used to decrypt the session key |
402 | * @crypt_stat: The cryptographic context | ||
402 | * | 403 | * |
403 | * Returns Zero on success; non-zero error otherwise. | 404 | * Returns zero on success; non-zero error otherwise. |
404 | */ | 405 | */ |
405 | static int | 406 | static int |
406 | decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | 407 | decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, |
@@ -484,18 +485,18 @@ struct kmem_cache *ecryptfs_auth_tok_list_item_cache; | |||
484 | 485 | ||
485 | /** | 486 | /** |
486 | * parse_tag_1_packet | 487 | * parse_tag_1_packet |
487 | * @crypt_stat: The cryptographic context to modify based on packet | 488 | * @crypt_stat: The cryptographic context to modify based on packet contents |
488 | * contents. | ||
489 | * @data: The raw bytes of the packet. | 489 | * @data: The raw bytes of the packet. |
490 | * @auth_tok_list: eCryptfs parses packets into authentication tokens; | 490 | * @auth_tok_list: eCryptfs parses packets into authentication tokens; |
491 | * a new authentication token will be placed at the end | 491 | * a new authentication token will be placed at the |
492 | * of this list for this packet. | 492 | * end of this list for this packet. |
493 | * @new_auth_tok: Pointer to a pointer to memory that this function | 493 | * @new_auth_tok: Pointer to a pointer to memory that this function |
494 | * allocates; sets the memory address of the pointer to | 494 | * allocates; sets the memory address of the pointer to |
495 | * NULL on error. This object is added to the | 495 | * NULL on error. This object is added to the |
496 | * auth_tok_list. | 496 | * auth_tok_list. |
497 | * @packet_size: This function writes the size of the parsed packet | 497 | * @packet_size: This function writes the size of the parsed packet |
498 | * into this memory location; zero on error. | 498 | * into this memory location; zero on error. |
499 | * @max_packet_size: The maximum allowable packet size | ||
499 | * | 500 | * |
500 | * Returns zero on success; non-zero on error. | 501 | * Returns zero on success; non-zero on error. |
501 | */ | 502 | */ |
@@ -996,10 +997,11 @@ ecryptfs_find_auth_tok_for_sig( | |||
996 | } | 997 | } |
997 | 998 | ||
998 | /** | 999 | /** |
999 | * decrypt_passphrase_encrypted_session_key - Decrypt the session key | 1000 | * decrypt_passphrase_encrypted_session_key - Decrypt the session key with the given auth_tok. |
1000 | * with the given auth_tok. | 1001 | * @auth_tok: The passphrase authentication token to use to encrypt the FEK |
1002 | * @crypt_stat: The cryptographic context | ||
1001 | * | 1003 | * |
1002 | * Returns Zero on success; non-zero error otherwise. | 1004 | * Returns zero on success; non-zero error otherwise |
1003 | */ | 1005 | */ |
1004 | static int | 1006 | static int |
1005 | decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | 1007 | decrypt_passphrase_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, |
@@ -1102,8 +1104,9 @@ int ecryptfs_get_auth_tok_sig(char **sig, struct ecryptfs_auth_tok *auth_tok) | |||
1102 | 1104 | ||
1103 | /** | 1105 | /** |
1104 | * ecryptfs_parse_packet_set | 1106 | * ecryptfs_parse_packet_set |
1105 | * @dest: The header page in memory | 1107 | * @crypt_stat: The cryptographic context |
1106 | * @version: Version of file format, to guide parsing behavior | 1108 | * @src: Virtual address of region of memory containing the packets |
1109 | * @ecryptfs_dentry: The eCryptfs dentry associated with the packet set | ||
1107 | * | 1110 | * |
1108 | * Get crypt_stat to have the file's session key if the requisite key | 1111 | * Get crypt_stat to have the file's session key if the requisite key |
1109 | * is available to decrypt the session key. | 1112 | * is available to decrypt the session key. |
@@ -1354,7 +1357,10 @@ out: | |||
1354 | /** | 1357 | /** |
1355 | * write_tag_1_packet - Write an RFC2440-compatible tag 1 (public key) packet | 1358 | * write_tag_1_packet - Write an RFC2440-compatible tag 1 (public key) packet |
1356 | * @dest: Buffer into which to write the packet | 1359 | * @dest: Buffer into which to write the packet |
1357 | * @max: Maximum number of bytes that can be writtn | 1360 | * @remaining_bytes: Maximum number of bytes that can be writtn |
1361 | * @auth_tok: The authentication token used for generating the tag 1 packet | ||
1362 | * @crypt_stat: The cryptographic context | ||
1363 | * @key_rec: The key record struct for the tag 1 packet | ||
1358 | * @packet_size: This function will write the number of bytes that end | 1364 | * @packet_size: This function will write the number of bytes that end |
1359 | * up constituting the packet; set to zero on error | 1365 | * up constituting the packet; set to zero on error |
1360 | * | 1366 | * |
@@ -1441,7 +1447,7 @@ out: | |||
1441 | /** | 1447 | /** |
1442 | * write_tag_11_packet | 1448 | * write_tag_11_packet |
1443 | * @dest: Target into which Tag 11 packet is to be written | 1449 | * @dest: Target into which Tag 11 packet is to be written |
1444 | * @max: Maximum packet length | 1450 | * @remaining_bytes: Maximum packet length |
1445 | * @contents: Byte array of contents to copy in | 1451 | * @contents: Byte array of contents to copy in |
1446 | * @contents_length: Number of bytes in contents | 1452 | * @contents_length: Number of bytes in contents |
1447 | * @packet_length: Length of the Tag 11 packet written; zero on error | 1453 | * @packet_length: Length of the Tag 11 packet written; zero on error |
@@ -1501,7 +1507,7 @@ write_tag_11_packet(char *dest, size_t *remaining_bytes, char *contents, | |||
1501 | /** | 1507 | /** |
1502 | * write_tag_3_packet | 1508 | * write_tag_3_packet |
1503 | * @dest: Buffer into which to write the packet | 1509 | * @dest: Buffer into which to write the packet |
1504 | * @max: Maximum number of bytes that can be written | 1510 | * @remaining_bytes: Maximum number of bytes that can be written |
1505 | * @auth_tok: Authentication token | 1511 | * @auth_tok: Authentication token |
1506 | * @crypt_stat: The cryptographic context | 1512 | * @crypt_stat: The cryptographic context |
1507 | * @key_rec: encrypted key | 1513 | * @key_rec: encrypted key |
@@ -1707,7 +1713,7 @@ struct kmem_cache *ecryptfs_key_record_cache; | |||
1707 | 1713 | ||
1708 | /** | 1714 | /** |
1709 | * ecryptfs_generate_key_packet_set | 1715 | * ecryptfs_generate_key_packet_set |
1710 | * @dest: Virtual address from which to write the key record set | 1716 | * @dest_base: Virtual address from which to write the key record set |
1711 | * @crypt_stat: The cryptographic context from which the | 1717 | * @crypt_stat: The cryptographic context from which the |
1712 | * authentication tokens will be retrieved | 1718 | * authentication tokens will be retrieved |
1713 | * @ecryptfs_dentry: The dentry, used to retrieve the mount crypt stat | 1719 | * @ecryptfs_dentry: The dentry, used to retrieve the mount crypt stat |