aboutsummaryrefslogtreecommitdiffstats
path: root/src/context.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/context.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/context.c b/src/context.c
index 3e707ca..9e010aa 100644
--- a/src/context.c
+++ b/src/context.c
@@ -169,3 +169,19 @@ assuan_set_error (assuan_context_t ctx, gpg_error_t err, const char *text)
ctx->err_str = text;
return err;
}
+
+
+/* Return user credentials. For getting the pid of the peer the
+ assuan_get_pid is usually better suited. */
+gpg_error_t
+assuan_get_peercred (assuan_context_t ctx, assuan_peercred_t *peercred)
+{
+ if (!ctx)
+ return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE);
+ if (!ctx->peercred_valid)
+ return _assuan_error (ctx, GPG_ERR_ASS_GENERAL);
+
+ *peercred = &ctx->peercred;
+
+ return 0;
+}