summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/krb/mk_req.c
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1990-03-08 16:32:43 +0000
committerJohn Kohl <jtkohl@mit.edu>1990-03-08 16:32:43 +0000
commit229eb7ea1bc64418bb4488ccf3928f009cde17d0 (patch)
treef813a635478cfd24cd901e0ac48ddb161b95da39 /src/lib/krb5/krb/mk_req.c
parent06a0c77128f24c67e71b3430a92dffe0a0250b1f (diff)
downloadkrb5-229eb7ea1bc64418bb4488ccf3928f009cde17d0.tar.gz
krb5-229eb7ea1bc64418bb4488ccf3928f009cde17d0.tar.xz
krb5-229eb7ea1bc64418bb4488ccf3928f009cde17d0.zip
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@372 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/krb/mk_req.c')
-rw-r--r--src/lib/krb5/krb/mk_req.c78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/lib/krb5/krb/mk_req.c b/src/lib/krb5/krb/mk_req.c
new file mode 100644
index 000000000..d5324d6ac
--- /dev/null
+++ b/src/lib/krb5/krb/mk_req.c
@@ -0,0 +1,78 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/mit-copyright.h>.
+ *
+ * krb5_mk_req() routine.
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char mk_req_c[] =
+"$Id$";
+#endif /* !lint & !SABER */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+
+/*
+ Formats a KRB_AP_REQ message into outbuf.
+
+ server specifies the principal of the server to receive the message; if
+ credentials are not present in the credentials cache for this server, the
+ TGS request with default parameters is used in an attempt to obtain
+ such credentials, and they are stored in ccache.
+
+ kdc_options specifies the options requested for the
+ ap_req_options specifies the KRB_AP_REQ options desired.
+
+ checksum specifies the checksum to be used in the authenticator.
+
+ The outbuf buffer storage is allocated, and should be freed by the
+ caller when finished.
+
+ returns system errors
+*/
+
+extern krb5_flags krb5_kdc_default_options;
+
+krb5_error_code
+krb5_mk_req(server, ap_req_options, checksum, ccache, outbuf)
+krb5_principal server;
+krb5_flags ap_req_options;
+krb5_checksum *checksum;
+krb5_ccache ccache;
+krb5_data *outbuf;
+{
+ krb5_error_code retval;
+ krb5_creds creds;
+
+ /* obtain ticket & session key */
+
+ bzero((char *)&creds, sizeof(creds));
+ creds.server = server;
+ if (retval = krb5_cc_get_principal(ccache, &creds.client))
+ return(retval);
+ /* creds.times.endtime = 0; -- bzero takes care of this
+ zero means "as long as possible" */
+ /* creds.keyblock.keytype = 0; -- as well as this.
+ zero means no session keytype
+ preference */
+
+ if (retval = krb5_get_credentials(krb5_kdc_default_options,
+ ccache,
+ &creds))
+ return(retval);
+
+ retval = krb5_mk_req_extended(ap_req_options,
+ checksum,
+ &creds.times,
+ krb5_kdc_default_options,
+ ccache,
+ &creds,
+ outbuf);
+ return retval;
+}