aboutsummaryrefslogtreecommitdiff
path: root/pam/pam.h
diff options
context:
space:
mode:
authorJoseph Richey <joerichey@google.com>2017-07-17 18:26:19 -0700
committerGitHub <noreply@github.com>2017-07-17 18:26:19 -0700
commit3d08d9f6891db3ca94337e9b987ef62cba535fe1 (patch)
treeca9476a0aecaf79cfc8716875db073ea54d5f748 /pam/pam.h
parent6f32bbc8bf51d615ef23ed37aa40910ec23cd587 (diff)
parent1a4a020ad5766fce3b3ad719d85593a3e8159733 (diff)
Merge pull request #21 from google/fix
Add PAM package
Diffstat (limited to 'pam/pam.h')
-rw-r--r--pam/pam.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/pam/pam.h b/pam/pam.h
index 83ef2a9..9f3cdb2 100644
--- a/pam/pam.h
+++ b/pam/pam.h
@@ -22,10 +22,23 @@
#include <security/pam_appl.h>
-// fscrypt_service is the display name of the service requesting the passphrase.
-const char* fscrypt_service;
+// Conversation that will call back into Go code when appropriate.
+const struct pam_conv conv;
-// pam_init initializes the pam_conv structure for use with our Go callbacks.
-void pam_init(struct pam_conv* conv);
+// CleaupFuncs are used to cleanup specific PAM data.
+typedef void (*CleanupFunc)(pam_handle_t *pamh, void *data, int error_status);
-#endif
+// CleaupFunc that calls free() on data.
+void freeData(pam_handle_t *pamh, void *data, int error_status);
+
+// CleaupFunc that frees each item in a null terminated array of pointers and
+// then frees the array itself.
+void freeArray(pam_handle_t *pamh, void **array, int error_status);
+
+// Creates a copy of a C string, which resides in an locked buffer.
+void *copyIntoSecret(void *data);
+
+// CleaupFunc that Zeros wipes a C string and unlocks and frees its memory.
+void freeSecret(pam_handle_t *pamh, char *data, int error_status);
+
+#endif // FSCRYPT_PAM_H