summaryrefslogtreecommitdiffstats
path: root/src/kadmin/client/kadmin_done.c
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1992-09-29 14:51:34 +0000
committerTheodore Tso <tytso@mit.edu>1992-09-29 14:51:34 +0000
commitd4e95b17ce5d033759cb529f0cada608982ef5c8 (patch)
tree0182c5c657e0df883466a0aa593788829919b39b /src/kadmin/client/kadmin_done.c
parentd96ae575ff8eef11fe1dfb3bffdede9d31cb5e57 (diff)
downloadkrb5-d4e95b17ce5d033759cb529f0cada608982ef5c8.tar.gz
krb5-d4e95b17ce5d033759cb529f0cada608982ef5c8.tar.xz
krb5-d4e95b17ce5d033759cb529f0cada608982ef5c8.zip
*** empty log message ***
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2444 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin/client/kadmin_done.c')
-rw-r--r--src/kadmin/client/kadmin_done.c93
1 files changed, 93 insertions, 0 deletions
diff --git a/src/kadmin/client/kadmin_done.c b/src/kadmin/client/kadmin_done.c
new file mode 100644
index 000000000..7ae8d579f
--- /dev/null
+++ b/src/kadmin/client/kadmin_done.c
@@ -0,0 +1,93 @@
+/*
+ * $Source$
+ * $Author$
+ *
+ * Copyright 1988 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
+ *
+ */
+
+/*
+ * Sandia National Laboratories also makes no representations about the
+ * suitability of the modifications, or additions to this software for
+ * any purpose. It is provided "as is" without express or implied warranty.
+ */
+
+#if !defined(lint) && !defined(SABER)
+static char rcsid_kadmin_done[] =
+ "$Header$";
+#endif /* lint */
+
+/*
+ * kadmin_done
+ * Perform Remote Kerberos Administrative Functions
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#ifndef __convex__
+#include <strings.h>
+#endif
+#include <com_err.h>
+
+#include <krb5/adm_defs.h>
+
+#include <krb5/krb5.h>
+#include <krb5/ext-proto.h>
+#include <krb5/los-proto.h>
+#include <krb5/kdb.h>
+#include <krb5/kdb_dbm.h>
+
+krb5_error_code
+kadm_done(my_creds, rep_ret, local_addr, foreign_addr, local_socket, seqno)
+krb5_creds *my_creds;
+krb5_ap_rep_enc_part *rep_ret;
+krb5_address *local_addr, *foreign_addr;
+int *local_socket;
+krb5_int32 *seqno;
+{
+ krb5_data msg_data, inbuf;
+ krb5_error_code retval; /* return code */
+
+ /* XXX 755 was sizeof( char username[755]) */
+ if ((inbuf.data = (char *) calloc(1, 8 + 755)) == (char *) 0) {
+ fprintf(stderr, "No memory for command!\n");
+ exit(1);
+ }
+
+ inbuf.data[0] = KADMIN;
+ inbuf.data[1] = COMPLETE;
+ inbuf.data[2] = SENDDATA2;
+ inbuf.data[3] = 0xff;
+ (void) memset( inbuf.data + 4, 0, 4);
+ inbuf.length = 16;
+
+ if ((retval = krb5_mk_priv(&inbuf,
+ ETYPE_DES_CBC_CRC,
+ &my_creds->keyblock,
+ local_addr,
+ foreign_addr,
+ *seqno,
+ KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
+ 0,
+ 0,
+ &msg_data))) {
+ fprintf(stderr, "Error during Second Message Encoding: %s!\n",
+ error_message(retval));
+ return(1);
+ }
+ free(inbuf.data);
+
+ /* write private message to server */
+ if (krb5_write_message(local_socket, &msg_data)){
+ fprintf(stderr, "Write Error During Second Message Transmission!\n");
+ return(1);
+ }
+ free(msg_data.data);
+ return(0);
+}