[Pvfs2-cvs] commit by walt in pvfs2-1/src/common/security: pint-security.h pint-security.c

CVS commit program cvs at parl.clemson.edu
Mon May 12 11:57:35 EDT 2008


Update of /projects/cvsroot/pvfs2-1/src/common/security
In directory parlweb1:/tmp/cvs-serv28272/src/common/security

Added Files:
      Tag: cu-security-branch
	pint-security.h pint-security.c 
Log Message:
security extensions


--- /dev/null	2004-06-24 14:04:38.000000000 -0400
+++ pint-security.h	2008-05-12 11:57:35.000000000 -0400
@@ -0,0 +1,86 @@
+/* 
+ * (C) 2008 Clemson University and The University of Chicago 
+ *
+ * See COPYING in top-level directory.
+ */
+#ifndef PINT_SECURITY_H
+#define PINT_SECURITY_H
+
+#include "pvfs2-config.h"
+#include "pvfs2-types.h"
+
+/* must include a security module and link it in */
+#include "rsa_security.h"
+
+/* NOTE: add signer ID to each structure */
+
+typedef struct PVFS_capability PVFS_capability;
+struct PVFS_capability {
+	PVFS_sig signature;
+	PVFS_time timeout;  /* seconds after epoch to time out */
+	uint32_t op_mask;
+	uint32_t num_handles;
+	PVFS_handle *handle_array;
+};
+
+endecode_fields_3a (
+		PVFS_capability,
+		PVFS_sig, signature,
+		PVFS_time, timeout,
+		uint32_t, op_mask,
+		uint32_t, num_handles,
+		PVFS_handle, handle_array)
+
+typedef struct PVFS_credentials PVFS_credentials;
+struct PVFS_credentials {
+	PVFS_sig signature;
+	PVFS_time timeout;  /* seconds after epoch to time out */
+	PVFS_uid userid;
+	uint32_t num_groups;
+	PVFS_gid *group_array;
+};
+
+endecode_fields_3a (
+	PVFS_credentials,
+	PVFS_sig, signature,
+	PVFS_time, timeout,
+	PVFS_uid, userid,
+	uint32_t, num_groups,
+	PVFS_gid, group_array,
+};
+
+/* top-level security functions */
+
+/* creates a signature from the remaining fields
+ * any existing signature is overwritten
+ */
+void PINT_sign_capability(PVFS_capability *);
+
+/* computes a signature from the fields and compares 
+ * to the existing signature returns non-zero if equal
+ * nothing changed in the structure
+ */
+int PINT_verify_capability(PVFS_capability *);
+
+/* creates a signature from the remaining fields
+ * any existing signature is overwritten
+ */
+void PINT_sign_credentials (PVFS_credentials *);
+
+/* computes a signature from the fields and compares 
+ * to the existing signature returns non-zero if equal
+ * nothing changed in the structure
+ */
+int PINT_verify_credentials (PVFS_credentials *);
+
+
+#endif
+
+/*
+ * Local variables:
+ *  c-indent-level: 4
+ *  c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */

--- /dev/null	2004-06-24 14:04:38.000000000 -0400
+++ pint-security.c	2008-05-12 11:57:35.000000000 -0400
@@ -0,0 +1,26 @@
+/* 
+ * (C) 2008 Clemson University and The University of Chicago 
+ *
+ * See COPYING in top-level directory.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#include "pvfs2.h"
+#include "pint-eattr.h"
+#include "pvfs2-req-proto.h"
+#include "pvfs2-internal.h"
+
+
+
+/*
+ * Local variables:
+ *  c-indent-level: 4
+ *  c-basic-offset: 4
+ * End:
+ *
+ * vim: ts=8 sts=4 sw=4 expandtab
+ */
\ No newline at end of file



More information about the Pvfs2-cvs mailing list