summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/krb/rd_req.c
diff options
context:
space:
mode:
authorJohn Kohl <jtkohl@mit.edu>1990-03-09 11:41:52 +0000
committerJohn Kohl <jtkohl@mit.edu>1990-03-09 11:41:52 +0000
commit560b7153c8acc85619e580fc51c365837daa27fc (patch)
tree9b75fc67026926e871d7e0ccde90b5942567d34e /src/lib/krb5/krb/rd_req.c
parent361ffef8443c7200f1363de8a1353b67b9e4370e (diff)
downloadkrb5-560b7153c8acc85619e580fc51c365837daa27fc.tar.gz
krb5-560b7153c8acc85619e580fc51c365837daa27fc.tar.xz
krb5-560b7153c8acc85619e580fc51c365837daa27fc.zip
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@379 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/krb/rd_req.c')
-rw-r--r--src/lib/krb5/krb/rd_req.c83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/lib/krb5/krb/rd_req.c b/src/lib/krb5/krb/rd_req.c
new file mode 100644
index 000000000..8908d4be5
--- /dev/null
+++ b/src/lib/krb5/krb/rd_req.c
@@ -0,0 +1,83 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/mit-copyright.h>.
+ *
+ * krb5_rd_req()
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rd_req_c[] =
+"$Id$";
+#endif /* !lint & !SABER */
+
+#include <krb5/copyright.h>
+#include <krb5/krb5.h>
+#include <krb5/krb5_err.h>
+#include <krb5/isode_err.h>
+
+#include <krb5/asn1.h>
+#include <krb5/ext-proto.h>
+
+/*
+ Parses a KRB_AP_REQ message, returning its contents.
+
+ server specifies the expected server's name for the ticket.
+
+ sender_addr specifies the address(es) expected to be present in the
+ ticket.
+
+ rcache specifies a replay detection cache used to store authenticators and
+ server names
+
+ keyproc specifies a procedure to generate a decryption key for the
+ ticket. If keyproc is non-NULL, keyprocarg is passed to it, and the result
+ used as a decryption key. If keyproc is NULL, then fetchfrom is checked;
+ if it is non-NULL, it specifies a parameter name from which to retrieve the
+ decryption key. If fetchfrom is NULL, then the default key store is
+ consulted.
+
+ authdat->ticket and authdat->authenticator are set to allocated storage
+ structures; the caller should free them when finished.
+
+ returns system errors, encryption errors, replay errors
+ */
+
+krb5_error_code
+krb5_rd_req(inbuf, server, sender_addr, fetchfrom, keyproc, keyprocarg,
+ rcache, authdat)
+krb5_data *inbuf;
+krb5_principal server;
+krb5_address *sender_addr;
+krb5_pointer fetchfrom;
+krb5_error_code (*keyproc) PROTOTYPE((krb5_pointer,
+ krb5_principal,
+ krb5_kvno,
+ krb5_keyblock **));
+krb5_pointer keyprocarg;
+krb5_rcache rcache;
+krb5_tkt_authent *authdat;
+{
+ krb5_error_code retval;
+ krb5_ap_req *request;
+
+ if (retval = decode_krb5_ap_req(inbuf, &request)) {
+ switch (retval) {
+ case ISODE_50_LOCAL_ERR_BADMSGTYPE:
+ return KRB5KRB_AP_ERR_BADVERSION; /* XXX ? */
+ default:
+ return(retval);
+ }
+
+ }
+
+ retval = krb5_rd_req_decoded(request, server, sender_addr, fetchfrom,
+ keyproc, keyprocarg, rcache, authdat);
+ krb5_free_ap_req(request);
+ return retval;
+}
+