summaryrefslogtreecommitdiff
path: root/auth/credentials/credentials.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth/credentials/credentials.c')
-rw-r--r--auth/credentials/credentials.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index ac2b42a669b..5c39569e34a 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -446,6 +446,26 @@ _PUBLIC_ const char *cli_credentials_get_password(struct cli_credentials *cred)
return cred->password;
}
+/**
+ * @brief Obtain the password for this credentials context.
+ *
+ * @param[in] cred The credential context.
+ *
+ * @param[in] obtained A pointer to store the obtained information.
+ *
+ * return The user name or NULL if an error occured.
+ */
+_PUBLIC_ const char *
+cli_credentials_get_password_and_obtained(struct cli_credentials *cred,
+ enum credentials_obtained *obtained)
+{
+ if (obtained != NULL) {
+ *obtained = cred->password_obtained;
+ }
+
+ return cli_credentials_get_password(cred);
+}
+
/* Set a password on the credentials context, including an indication
* of 'how' the password was obtained */