[Pvfs2-cvs] commit by dbonnie in pvfs2/src/common/security:
pint-security.c pint-security.h security-hash.c security-hash.h
CVS commit program
cvs at parl.clemson.edu
Mon May 19 12:19:40 EDT 2008
Update of /anoncvs/pvfs2/src/common/security
In directory parlweb1:/tmp/cvs-serv3626
Modified Files:
Tag: cu-security-branch
pint-security.c pint-security.h security-hash.c
security-hash.h
Log Message:
Fixed tabbing/spacing
Index: pint-security.c
===================================================================
RCS file: /anoncvs/pvfs2/src/common/security/Attic/pint-security.c,v
diff -p -u -r1.1.2.7 -r1.1.2.8
--- pint-security.c 19 May 2008 15:45:14 -0000 1.1.2.7
+++ pint-security.c 19 May 2008 16:19:40 -0000 1.1.2.8
@@ -39,13 +39,13 @@ static int load_public_keys(char*);
static int lookup_host_handle(uint32_t*, const char*);
-/* PINT_security_initialize
+/* PINT_security_initialize
*
- * Initializes the security module
+ * Initializes the security module
*
- * returns PVFS_EALREADY if already initialized
- * returns PVFS_EIO if key file is missing or invalid
- * returns 0 on sucess
+ * returns PVFS_EALREADY if already initialized
+ * returns PVFS_EIO if key file is missing or invalid
+ * returns 0 on sucess
*/
int PINT_security_initialize(void)
{
@@ -80,12 +80,12 @@ int PINT_security_initialize(void)
return 0;
}
-/* PINT_security_finalize
+/* PINT_security_finalize
*
- * Finalizes the security module
+ * Finalizes the security module
*
- * returns PVFS_EALREADY if already finalized
- * returns 0 on sucess
+ * returns PVFS_EALREADY if already finalized
+ * returns 0 on sucess
*/
int PINT_security_finalize(void)
{
@@ -106,17 +106,17 @@ int PINT_security_finalize(void)
return 0;
}
-/* load_public_keys
+/* load_public_keys
*
- * Internal function to load keys from a file.
- * File path includes the filename
- * When finished without error, hash table will be filled
- * with all host ID / public key pairs.
+ * Internal function to load keys from a file.
+ * File path includes the filename
+ * When finished without error, hash table will be filled
+ * with all host ID / public key pairs.
*
- * returns -1 on file I/O error
- * returns -2 on host lookup failure
- * returns -3 on hash table failure
- * returns 0 on sucess
+ * returns -1 on file I/O error
+ * returns -2 on host lookup failure
+ * returns -3 on hash table failure
+ * returns 0 on sucess
*/
static int load_public_keys(char *path)
{
@@ -193,13 +193,13 @@ static int load_public_keys(char *path)
return 0;
}
-/* lookup_host_handle
+/* lookup_host_handle
*
- * Searches the server config to find *alias and sets *host to
- * the index (host ID) when *alias is found.
+ * Searches the server config to find *alias and sets *host to
+ * the index (host ID) when *alias is found.
*
- * returns -1 on lookup failure
- * returns 0 on sucess, *host contains host ID
+ * returns -1 on lookup failure
+ * returns 0 on sucess, *host contains host ID
*/
static int lookup_host_handle(uint32_t *host, const char *alias)
{
@@ -217,12 +217,12 @@ static int lookup_host_handle(uint32_t *
a = (host_alias_s*)iter->item;
if (a == NULL)
{
- // end of list
+ // end of list
continue;
}
if (strcmp(a->host_alias, alias) == 0)
{
- // matching alias
+ // matching alias
*host = index;
return 0;
}
@@ -238,5 +238,5 @@ static int lookup_host_handle(uint32_t *
* c-basic-offset: 4
* End:
*
- * vim: ts=4 sts=4 sw=4 expandtab
+ * vim: ts=8 sts=4 sw=4 expandtab
*/
Index: pint-security.h
===================================================================
RCS file: /anoncvs/pvfs2/src/common/security/Attic/pint-security.h,v
diff -p -u -r1.1.2.5 -r1.1.2.6
--- pint-security.h 19 May 2008 15:45:14 -0000 1.1.2.5
+++ pint-security.h 19 May 2008 16:19:40 -0000 1.1.2.6
@@ -18,7 +18,7 @@ typedef struct PVFS_capability PVFS_capa
struct PVFS_capability {
uint32_t owner;
PVFS_sig signature;
- PVFS_time timeout; /* seconds after epoch to time out */
+ PVFS_time timeout; /* seconds after epoch to time out */
uint32_t op_mask;
uint32_t num_handles;
PVFS_handle *handle_array;
@@ -49,24 +49,24 @@ struct PVFS_credentials {
uint32_t, num_groups,
PVFS_gid, group_array)*/
-/* top-level security functions */
+/* top-level security functions */
-/* PINT_security_initialize
+/* PINT_security_initialize
*
- * Initializes the security module
+ * Initializes the security module
*
- * returns PVFS_EALREADY if already initialized
- * returns PVFS_EIO if key file is missing or invalid
- * returns 0 on sucess
+ * returns PVFS_EALREADY if already initialized
+ * returns PVFS_EIO if key file is missing or invalid
+ * returns 0 on sucess
*/
int PINT_security_initialize(void);
-/* PINT_security_finalize
+/* PINT_security_finalize
*
- * Finalizes the security module
+ * Finalizes the security module
*
- * returns PVFS_EALREADY if already finalized
- * returns 0 on sucess
+ * returns PVFS_EALREADY if already finalized
+ * returns 0 on sucess
*/
int PINT_security_finalize(void);
Index: security-hash.c
===================================================================
RCS file: /anoncvs/pvfs2/src/common/security/Attic/security-hash.c,v
diff -p -u -r1.1.2.10 -r1.1.2.11
--- security-hash.c 19 May 2008 15:45:14 -0000 1.1.2.10
+++ security-hash.c 19 May 2008 16:19:40 -0000 1.1.2.11
@@ -14,9 +14,9 @@
#include "gen-locks.h"
-/* 71 seems to be a reasonable size, could be increased
- * if collisions start to become a problem. Prime numbers
- * are preferred. */
+/* 71 seems to be a reasonable size, could be increased
+ * if collisions start to become a problem. Prime numbers
+ * are preferred. */
#define DEFAULT_SECURITY_TABLE_SIZE 71
@@ -24,28 +24,28 @@
typedef struct pubkey_entry_s {
- struct qlist_head hash_link; // holds prev/next pointers
- uint32_t host; // Host ID
- EVP_PKEY *pubkey; // public key for above host ID
+ struct qlist_head hash_link; // holds prev/next pointers
+ uint32_t host; // Host ID
+ EVP_PKEY *pubkey; // public key for above host ID
} pubkey_entry_t;
-static struct qhash_table *pubkey_table = NULL; // head of the table
-static int hash_init_status = 0; // 1 = init, 0 = not init
-static gen_mutex_t hash_mutex = GEN_MUTEX_INITIALIZER; // write mutex
+static struct qhash_table *pubkey_table = NULL; // head of the table
+static int hash_init_status = 0; // 1 = init, 0 = not init
+static gen_mutex_t hash_mutex = GEN_MUTEX_INITIALIZER; // write mutex
-static int pubkey_compare(void*, struct qhash_head*); // internal compare
-static void free_pubkey_entry(void*); // internal free
+static int pubkey_compare(void*, struct qhash_head*); // internal compare
+static void free_pubkey_entry(void*); // internal free
-/* SECURITY_hash_initialize
+/* SECURITY_hash_initialize
*
- * Initializes the hash table for use
+ * Initializes the hash table for use
*
- * returns PVFS_EALREADY if already initialized
- * returns PVFS_ENOMEM if memory cannot be allocated
- * returns 0 on success
+ * returns PVFS_EALREADY if already initialized
+ * returns PVFS_ENOMEM if memory cannot be allocated
+ * returns 0 on success
*/
int SECURITY_hash_initialize(void)
{
@@ -70,12 +70,12 @@ int SECURITY_hash_initialize(void)
return 0;
}
-/* SECURITY_hash_finalize
+/* SECURITY_hash_finalize
*
- * Frees everything allocated within the table
- * and anything used to set it up
+ * Frees everything allocated within the table
+ * and anything used to set it up
*
- * returns nothing
+ * returns nothing
*/
void SECURITY_hash_finalize(void)
{
@@ -93,15 +93,15 @@ void SECURITY_hash_finalize(void)
gen_mutex_unlock(&hash_mutex);
}
-/* SECURITY_add_pubkey
+/* SECURITY_add_pubkey
*
- * Takes an EVP_PKEY and inserts it into the hash table
- * based on the host ID. If the host ID already
- * exists in the table, it's corresponding key is replaced
- * with the new one
+ * Takes an EVP_PKEY and inserts it into the hash table
+ * based on the host ID. If the host ID already
+ * exists in the table, it's corresponding key is replaced
+ * with the new one
*
- * returns PVFS_ENOMEM if memory cannot be allocated
- * returns 0 on success
+ * returns PVFS_ENOMEM if memory cannot be allocated
+ * returns 0 on success
*/
int SECURITY_add_pubkey(uint32_t host, EVP_PKEY *pubkey)
{
@@ -131,12 +131,12 @@ int SECURITY_add_pubkey(uint32_t host, E
return 0;
}
-/* SECURITY_lookup_pubkey
+/* SECURITY_lookup_pubkey
*
- * Takes a host ID and returns a pointer to the
- * matching EVP_PKEY structure
+ * Takes a host ID and returns a pointer to the
+ * matching EVP_PKEY structure
*
- * returns NULL if no matching key is found
+ * returns NULL if no matching key is found
*/
EVP_PKEY *SECURITY_lookup_pubkey(uint32_t host)
{
@@ -154,14 +154,14 @@ EVP_PKEY *SECURITY_lookup_pubkey(uint32_
return entry->pubkey;
}
-/* pubkey_compare
+/* pubkey_compare
*
- * Takes in a key (in this case a host ID) and compares
- * it to the value of the host ID contained within the
- * structure passed in
+ * Takes in a key (in this case a host ID) and compares
+ * it to the value of the host ID contained within the
+ * structure passed in
*
- * returns 1 if the IDs match
- * returns 0 if they do not match or if the structure is invalid
+ * returns 1 if the IDs match
+ * returns 0 if they do not match or if the structure is invalid
*/
static int pubkey_compare(void *key, struct qhash_head *link)
{
@@ -175,12 +175,12 @@ static int pubkey_compare(void *key, str
return (temp->host == host);
}
-/* free_pubkey_entry
+/* free_pubkey_entry
*
- * Takes in a pointer to a pubkey_entry_t structure to free
- * Frees the key structure within as well as the passed-in struct
+ * Takes in a pointer to a pubkey_entry_t structure to free
+ * Frees the key structure within as well as the passed-in struct
*
- * no return value
+ * no return value
*/
static void free_pubkey_entry(void *to_free)
{
@@ -198,5 +198,6 @@ static void free_pubkey_entry(void *to_f
* c-basic-offset: 4
* End:
*
- * vim: ts=4 sts=4 sw=4 expandtab
+ * vim: ts=8 sts=4 sw=4 expandtab
*/
+
Index: security-hash.h
===================================================================
RCS file: /anoncvs/pvfs2/src/common/security/Attic/security-hash.h,v
diff -p -u -r1.1.2.5 -r1.1.2.6
--- security-hash.h 19 May 2008 15:45:14 -0000 1.1.2.5
+++ security-hash.h 19 May 2008 16:19:40 -0000 1.1.2.6
@@ -13,55 +13,55 @@
#include "pvfs2-types.h"
-/* SECURITY_hash_initialize
+/* SECURITY_hash_initialize
*
- * Initializes the hash table for use
+ * Initializes the hash table for use
*
- * returns PVFS_EALREADY if already initialized
- * returns PVFS_ENOMEM if memory cannot be allocated
- * returns 0 on success
+ * returns PVFS_EALREADY if already initialized
+ * returns PVFS_ENOMEM if memory cannot be allocated
+ * returns 0 on success
*/
int SECURITY_hash_initialize(void);
-/* SECURITY_hash_finalize
+/* SECURITY_hash_finalize
*
- * Frees everything allocated within the table
- * and anything used to set it up
+ * Frees everything allocated within the table
+ * and anything used to set it up
*
- * returns nothing
+ * returns nothing
*/
void SECURITY_hash_finalize(void);
-/* SECURITY_add_pubkey
+/* SECURITY_add_pubkey
*
- * Takes an EVP_PKEY and inserts it into the hash table
- * based on the host ID. If the host ID already
- * exists in the table, it's corresponding key is replaced
- * with the new one
+ * Takes an EVP_PKEY and inserts it into the hash table
+ * based on the host ID. If the host ID already
+ * exists in the table, it's corresponding key is replaced
+ * with the new one
*
- * returns PVFS_ENOMEM if memory cannot be allocated
- * returns 0 on success
+ * returns PVFS_ENOMEM if memory cannot be allocated
+ * returns 0 on success
*/
int SECURITY_add_pubkey(uint32_t host, EVP_PKEY *pubkey);
-/* SECURITY_lookup_pubkey
+/* SECURITY_lookup_pubkey
*
- * Takes a host ID and returns a pointer to the
- * matching EVP_PKEY structure
+ * Takes a host ID and returns a pointer to the
+ * matching EVP_PKEY structure
*
- * returns NULL if no matching key is found
+ * returns NULL if no matching key is found
*/
EVP_PKEY *SECURITY_lookup_pubkey(uint32_t host);
#endif /* _SECURITY_HASH_H_ */
-
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
- * vim: ts=4 sts=4 sw=4 expandtab
+ * vim: ts=8 sts=4 sw=4 expandtab
*/
+
More information about the Pvfs2-cvs
mailing list