[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS shishi/lib
From: |
shishi-commit |
Subject: |
CVS shishi/lib |
Date: |
Thu, 23 Mar 2006 11:34:01 +0100 |
Update of /home/jas/self/public-cvs/shishi/lib
In directory latte:/home/jas/self/src/shishi/lib
Modified Files:
shishi.h.in principal.c
Log Message:
Add shishi_derive_default_salt.
--- /home/jas/self/public-cvs/shishi/lib/shishi.h.in 2006/03/22 15:31:13
1.263
+++ /home/jas/self/public-cvs/shishi/lib/shishi.h.in 2006/03/23 10:33:53
1.264
@@ -681,6 +681,9 @@
const char *namefield, const char *name);
extern int shishi_parse_name (Shishi * handle, const char *name,
char **principal, char **realm);
+extern int shishi_derive_default_salt (Shishi * handle,
+ const char *name,
+ char **salt);
extern char *shishi_server_for_local_service (Shishi * handle,
const char *service);
--- /home/jas/self/public-cvs/shishi/lib/principal.c 2006/02/07 12:34:11
1.43
+++ /home/jas/self/public-cvs/shishi/lib/principal.c 2006/03/23 10:33:53
1.44
@@ -425,6 +425,45 @@
}
/**
+ * shishi_derive_default_salt:
+ * @handle: shishi handle as allocated by shishi_init().
+ * @name: principal name of user.
+ * @salt: output variable with newly allocated salt string.
+ *
+ * Derive the default salt from a principal. The default salt is the
+ * concatenation of the decoded realm and principal.
+ *
+ * Return value: Return SHISHI_OK if successful.
+ **/
+int
+shishi_derive_default_salt (Shishi * handle,
+ const char *name,
+ char **salt)
+{
+ char *principal;
+ char *realm;
+ char *salt;
+ int rc;
+
+ rc = shishi_parse_name (handle, name, &principal, &realm);
+ if (rc != SHISHI_OK)
+ return rc;
+
+ if (!principal || !realm)
+ {
+ if (principal)
+ free (principal);
+ if (realm)
+ free (realm);
+ return SHISHI_INVALID_PRINCIPAL_NAME;
+ }
+
+ xasprintf (salt, "%s%s", realm, principal);
+
+ return SHISHI_OK;
+}
+
+/**
* shishi_server_for_local_service:
* @handle: shishi handle as allocated by shishi_init().
* @service: zero terminated string with name of service, e.g., "host".
- CVS shishi/lib, (continued)
- CVS shishi/lib, shishi-commit, 2006/03/13
- CVS shishi/lib, shishi-commit, 2006/03/23
- CVS shishi/lib, shishi-commit, 2006/03/23
- CVS shishi/lib, shishi-commit, 2006/03/23
- CVS shishi/lib, shishi-commit, 2006/03/23
- CVS shishi/lib, shishi-commit, 2006/03/23
- CVS shishi/lib, shishi-commit, 2006/03/23
- CVS shishi/lib, shishi-commit, 2006/03/27
- CVS shishi/lib, shishi-commit, 2006/03/27
- CVS shishi/lib, shishi-commit, 2006/03/27
- CVS shishi/lib,
shishi-commit <=
- CVS shishi/lib, shishi-commit, 2006/03/27
- CVS shishi/lib, shishi-commit, 2006/03/27
- CVS shishi/lib, shishi-commit, 2006/03/30
- CVS shishi/lib, shishi-commit, 2006/03/30
- CVS shishi/lib, shishi-commit, 2006/03/30
- CVS shishi/lib, shishi-commit, 2006/03/30
- CVS shishi/lib, shishi-commit, 2006/03/30