* kadmin.c, kadmin_adr.c, kadmin_cpw.c, kadmin_done.c, kadmin_mod.c
authorChris Provenzano <proven@mit.edu>
Fri, 10 Mar 1995 17:27:20 +0000 (17:27 +0000)
committerChris Provenzano <proven@mit.edu>
Fri, 10 Mar 1995 17:27:20 +0000 (17:27 +0000)
* kadmin_add.c, kadmin_cpr.c, kadmin_del.c, kadmin_inq.c, kadmin_msnd.c
Use new calling convention for krb5_sendauth(), krb5_mk_priv(),
krb5_rd_priv(), krb5_mk_safe(), and krb5_rd_safe().

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5100 dc483132-0cff-0310-8789-dd5450dbe970

src/kadmin/client/ChangeLog
src/kadmin/client/kadmin.c
src/kadmin/client/kadmin_add.c
src/kadmin/client/kadmin_adr.c
src/kadmin/client/kadmin_cpr.c
src/kadmin/client/kadmin_cpw.c
src/kadmin/client/kadmin_del.c
src/kadmin/client/kadmin_done.c
src/kadmin/client/kadmin_inq.c
src/kadmin/client/kadmin_mod.c
src/kadmin/client/kadmin_msnd.c

index deee1c937edd7656a694367a19ae955b085e3750..d6753db063c89f7bc0b6efbb01ec37ef909220c4 100644 (file)
@@ -1,3 +1,11 @@
+
+Fri Mar 10 11:09:34 1995  Chris Provenzano (proven@mit.edu)
+
+       * kadmin.c, kadmin_adr.c, kadmin_cpw.c, kadmin_done.c, kadmin_mod.c
+       * kadmin_add.c, kadmin_cpr.c, kadmin_del.c, kadmin_inq.c, kadmin_msnd.c
+               Use new calling convention for krb5_sendauth(), krb5_mk_priv(), 
+               krb5_rd_priv(), krb5_mk_safe(), and krb5_rd_safe().
+
 Thu Mar  2 12:24:25 1995  Theodore Y. Ts'o  <tytso@dcl>
 
        * Makefile.in (ISODELIB): Remove reference to $(ISODELIB).
index 93ce5e9eda153586bb47b075b1e07f2a144cde54..44d9219db6228bc7b13a79c00b6637403cd744c8 100644 (file)
@@ -35,7 +35,7 @@
 #define MAXPATHLEN 1024
 #endif
 
-#include "k5-int.h"
+#include "krb5.h"
 
 static krb5_error_code get_first_ticket 
        PROTOTYPE((krb5_context,
@@ -83,9 +83,7 @@ main(argc,argv)
     kadmin_requests rd_priv_resp;
 
     krb5_context context;
-    krb5_checksum send_cksum;
     krb5_data msg_data, inbuf;
-    krb5_int32 seqno;
     char buffer[255];
     char command_type[120];
     char princ_name[120];
@@ -94,6 +92,9 @@ main(argc,argv)
     int oper_type;
     int nflag = 0;
 
+    krb5_auth_context * new_auth_context;
+    krb5_replay_data replaydata;
+
     krb5_init_context(&context);
     krb5_init_ets(context);
 
@@ -209,49 +210,34 @@ main(argc,argv)
     foreign_addr.length = SIZEOF_INADDR ;
     foreign_addr.contents = (krb5_octet *) &remote_sin.sin_addr;
 
-               /* compute checksum, using CRC-32 */
-    if (!(send_cksum.contents = (krb5_octet *)
-       malloc(krb5_checksum_size(context, CKSUMTYPE_CRC32)))) {
-        fprintf(stderr, "Insufficient Memory while Allocating Checksum!\n");
-        (void) krb5_cc_destroy(context, cache);
-        exit(1);
-    }
-
-               /* choose some random stuff to compute checksum from */
-       if (retval = krb5_calculate_checksum(context, CKSUMTYPE_CRC32,
-                                       ADM5_ADM_VERSION,
-                                       strlen(ADM5_ADM_VERSION),
-                                       0,
-                                       0, /* if length is 0, crc-32 doesn't
-                                               use the seed */
-                                       &send_cksum)) {
-        fprintf(stderr, "Error while Computing Checksum: %s!\n",
-               error_message(retval));
-       free(send_cksum.contents);
-        (void) krb5_cc_destroy(context, cache);
-        exit(1);
-    }
+    krb5_auth_con_init(context, &new_auth_context);
+    krb5_auth_con_setflags(context, new_auth_context,
+                           KRB5_AUTH_CONTEXT_RET_SEQUENCE);
+  
+    krb5_auth_con_setaddrs(context, new_auth_context,
+                           &local_addr, &foreign_addr);
 
     /* call Kerberos library routine to obtain an authenticator,
        pass it over the socket to the server, and obtain mutual
        authentication. */
 
-    if ((retval = krb5_sendauth(context, (krb5_pointer) &local_socket,
+    inbuf.data = ADM5_ADM_VERSION;
+    inbuf.length = strlen(ADM5_ADM_VERSION);
+
+    if ((retval = krb5_sendauth(context, &new_auth_context,
+                       (krb5_pointer) &local_socket,
                        ADM_CPW_VERSION, 
                        my_creds.client, 
                        my_creds.server,
                        AP_OPTS_MUTUAL_REQUIRED,
-                       &send_cksum,
+                       &inbuf,
                        &my_creds,           
                        0,
-                       &seqno, 
-                       0,           /* don't need a subsession key */
                        &err_ret,
                        &rep_ret, 
                        NULL))) {
        fprintf(stderr, "Error while performing sendauth: %s!\n",
                        error_message(retval));
-       free(send_cksum.contents);
        exit(1);
     }
 
@@ -259,21 +245,18 @@ main(argc,argv)
     if (retval = krb5_read_message(context, &local_socket, &inbuf)){
        fprintf(stderr, " Read Message Error: %s!\n",
                        error_message(retval));
-       free(send_cksum.contents);
         exit(1);
     }
 
     if ((inbuf.length != 2) || (inbuf.data[0] != KADMIND) ||
                        (inbuf.data[1] != KADMSAG)){
        fprintf(stderr, " Invalid ack from admin server.!\n");
-       free(send_cksum.contents);
         exit(1);
     }
     free(inbuf.data);
 
     if ((inbuf.data = (char *) calloc(1, 2)) == (char *) 0) {
        fprintf(stderr, "No memory for command!\n");
-       free(send_cksum.contents);
         exit(1);
     }
 
@@ -281,20 +264,11 @@ main(argc,argv)
     inbuf.data[1] = 0xff;
     inbuf.length = 2;
 
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                       ETYPE_DES_CBC_CRC,
-                       &my_creds.keyblock, 
-                       &local_addr, 
-                       &foreign_addr,
-                       seqno,
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+    if ((retval = krb5_mk_priv(context, new_auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
        fprintf(stderr, "Error during First Message Encoding: %s!\n",
                        error_message(retval));
        free(inbuf.data);
-       free(send_cksum.contents);
         exit(1);
     }
     free(inbuf.data);
@@ -302,7 +276,6 @@ main(argc,argv)
                /* write private message to server */
     if (krb5_write_message(context, &local_socket, &msg_data)){
        fprintf(stderr, "Write Error During First Message Transmission!\n");
-       free(send_cksum.contents);
         exit(1);
     } 
     free(msg_data.data);
@@ -312,22 +285,13 @@ main(argc,argv)
        if (retval = krb5_read_message(context, &local_socket, &inbuf)){
            fprintf(stderr, "Read Error During First Reply: %s!\n",
                        error_message(retval));
-           free(send_cksum.contents);
             exit(1);
        }
 
-       if ((retval = krb5_rd_priv(context, &inbuf,
-                       &my_creds.keyblock,
-                       &foreign_addr, 
-                       &local_addr,
-                       rep_ret->seq_number, 
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+       if ((retval = krb5_rd_priv(context, new_auth_context, &inbuf,
+                                  &msg_data, &replaydata))) {
            fprintf(stderr, "Error during First Read Decoding: %s!\n", 
                        error_message(retval));
-           free(send_cksum.contents);
             exit(1);
        }
        free(inbuf.data);
@@ -346,109 +310,65 @@ repeat:
        if (!strcmp(command_type, "add")) {
            valid++;
            oper_type = ADDOPER;
-           if (retval = kadm_add_user(context, &my_creds, 
-                                      rep_ret,
-                                      &local_addr, 
-                                      &foreign_addr, 
-                                      &local_socket, 
-                                      &seqno,
-                                      oper_type,
-                                      princ_name)) break;
+           if (retval = kadm_add_user(context, new_auth_context, &my_creds, 
+                                      &local_socket, oper_type, princ_name)) 
+           break;
        }
        if (!strcmp(command_type, "cpw")) {
            valid++;
            oper_type = CHGOPER;
-           if (retval = kadm_cpw_user(context, &my_creds, 
-                                      rep_ret,
-                                      &local_addr, 
-                                      &foreign_addr, 
-                                      &local_socket, 
-                                      &seqno,
-                                      oper_type,
-                                      princ_name)) break;
+           if (retval = kadm_cpw_user(context, new_auth_context, &my_creds, 
+                                      &local_socket, oper_type, princ_name)) 
+           break;
        }
        if (!strcmp(command_type, "addrnd")) {
            valid++;
-           if (retval = kadm_add_user_rnd(context, &my_creds, 
-                                          rep_ret,
-                                          &local_addr, 
-                                          &foreign_addr, 
-                                          &local_socket, 
-                                          &seqno,
-                                          princ_name)) break;
+           if (retval = kadm_add_user_rnd(context, new_auth_context, &my_creds,
+                                          &local_socket, princ_name)) 
+           break;
        }
        if (!strcmp(command_type, "cpwrnd")) {
            valid++;
-           if (retval = kadm_cpw_user_rnd(context, &my_creds, 
-                                          rep_ret,
-                                          &local_addr, 
-                                          &foreign_addr, 
-                                          &local_socket, 
-                                          &seqno,
-                                          princ_name)) break;
+           if (retval = kadm_cpw_user_rnd(context, new_auth_context, &my_creds, 
+                                          &local_socket, princ_name)) 
+           break;
        }
        if (!strcmp(command_type, "del")) {
            valid++;
-           if (retval = kadm_del_user(context, &my_creds, 
-                                      rep_ret,
-                                      &local_addr, 
-                                      &foreign_addr, 
-                                      &local_socket, 
-                                      &seqno,
-                                      princ_name)) break;
+           if (retval = kadm_del_user(context, new_auth_context, &my_creds, 
+                                      &local_socket, princ_name)) 
+           break;
        }
        if (!strcmp(command_type, "inq")) {
            valid++;
-           if (retval = kadm_inq_user(context, &my_creds, 
-                                      rep_ret,
-                                      &local_addr, 
-                                      &foreign_addr, 
-                                      &local_socket, 
-                                      &seqno,
-                                      princ_name)) break;
+           if (retval = kadm_inq_user(context, new_auth_context, &my_creds, 
+                                      &local_socket, princ_name)) 
+           break;
        }
        if (!strcmp(command_type, "mod")) {
            valid++;
-           if (retval = kadm_mod_user(context, &my_creds, 
-                                      rep_ret,
-                                      &local_addr, 
-                                      &foreign_addr, 
-                                      &local_socket, 
-                                      &seqno,
-                                      princ_name)) break;
+           if (retval = kadm_mod_user(context, new_auth_context, &my_creds, 
+                                      &local_socket, princ_name)) 
+           break;
        }
        if (!strcmp(command_type, "addv4")) {
            valid++;
            oper_type = AD4OPER;
-           if (retval = kadm_add_user(context, &my_creds, 
-                                      rep_ret,
-                                      &local_addr, 
-                                      &foreign_addr, 
-                                      &local_socket, 
-                                      &seqno,
-                                      oper_type,
-                                      princ_name)) break;
+           if (retval = kadm_add_user(context, new_auth_context, &my_creds, 
+                                      &local_socket, oper_type, princ_name)) 
+           break;
        }
        if (!strcmp(command_type, "cpwv4")) {
            valid++;
            oper_type = CH4OPER;
-           if (retval = kadm_cpw_user(context, &my_creds, 
-                                      rep_ret,
-                                      &local_addr, 
-                                      &foreign_addr, 
-                                      &local_socket, 
-                                      &seqno,
-                                      oper_type,
-                                      princ_name)) break;
+           if (retval = kadm_cpw_user(context, new_auth_context, &my_creds, 
+                                      &local_socket, oper_type, princ_name)) 
+           break;
        }
        if (!strcmp(command_type, "q")) { 
            valid++;
-           retval = kadm_done(context, &my_creds, 
-                              rep_ret,
-                              &local_addr, 
-                              &foreign_addr, 
-                              &local_socket, 
-                              &seqno);
+           retval = kadm_done(context, new_auth_context, &my_creds, 
+                              &local_socket); 
            break;
        }
        
@@ -459,7 +379,6 @@ repeat:
     }
 
     if (retval) {
-       free(send_cksum.contents);
         exit(1);
     }
 
@@ -467,22 +386,13 @@ repeat:
     if (retval = krb5_read_message(context, &local_socket, &inbuf)){
        fprintf(stderr, "Read Error During Final Reply: %s!\n",
                         error_message(retval));
-       free(send_cksum.contents);
         exit(1);
     }
      
-    if ((retval = krb5_rd_priv(context, &inbuf,
-                        &my_creds.keyblock,
-                        &foreign_addr,
-                        &local_addr,
-                        rep_ret->seq_number,
-                        KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                        0,
-                        0,
-                        &msg_data))) {
+    if ((retval = krb5_rd_priv(context, new_auth_context, &inbuf,
+                               &msg_data, &replaydata))) {
        fprintf(stderr, "Error during Final Read Decoding :%s!\n",
                         error_message(retval));
-       free(send_cksum.contents);
        free(inbuf.data);
        exit(1);
     }
@@ -505,7 +415,6 @@ repeat:
     if (rd_priv_resp.message)
        free(rd_priv_resp.message);
 
-    free(send_cksum.contents);
     
     exit(retval);
 }
index b8f15eba228d379775efcca5ade2b2c01dc4189c..6c98be9a0b149bdabe10b8b5279264d90fa096e2 100644 (file)
 #include "com_err.h"
 
 #include <sys/param.h>
-#include "k5-int.h"
+
+#include "krb5.h"
 
 void decode_kadmind_reply();
 int print_status_message();
 
 krb5_error_code
-kadm_add_user(context, my_creds, rep_ret, local_addr, foreign_addr, 
-             local_socket, seqno, oper_type, principal)
-    krb5_context context;
-    krb5_creds *my_creds;
-    krb5_ap_rep_enc_part *rep_ret;
-    krb5_address *local_addr, *foreign_addr;
-    int *local_socket;
-    krb5_int32 *seqno;
-    int oper_type;
-    char *principal;
+kadm_add_user(context, auth_context, my_creds, local_socket, 
+             oper_type, principal)
+    krb5_context         context;
+    krb5_auth_context  * auth_context;
+    krb5_creds                 * my_creds;
+    int                * local_socket;
+    int                  oper_type;
+    char               * principal;
 {
     krb5_data msg_data, inbuf;
     kadmin_requests rd_priv_resp;
@@ -52,6 +51,7 @@ kadm_add_user(context, my_creds, rep_ret, local_addr, foreign_addr,
     char *password;
     int pwsize;
     int count;
+    krb5_replay_data replaydata;
     krb5_error_code retval;     /* return code */
     
     if ((inbuf.data = (char *) calloc(1, 3 + sizeof(username))) == (char *) 0) {
@@ -86,16 +86,8 @@ kadm_add_user(context, my_creds, rep_ret, local_addr, foreign_addr,
     (void) memcpy( inbuf.data + 3, username, strlen(username));
     inbuf.length = strlen(username) + 3;
     
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                              ETYPE_DES_CBC_CRC,
-                              &my_creds->keyblock, 
-                              local_addr, 
-                              foreign_addr,
-                              *seqno,
-                              KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                              0,
-                              0,
-                              &msg_data))) {
+    if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                error_message(retval));
        free(inbuf.data);
@@ -117,15 +109,8 @@ kadm_add_user(context, my_creds, rep_ret, local_addr, foreign_addr,
         return(1);
     }
     
-    if (retval = krb5_rd_priv(context, &inbuf,
-                              &my_creds->keyblock,
-                              foreign_addr, 
-                              local_addr,
-                              rep_ret->seq_number, 
-                              KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                              0,
-                              0,
-                              &msg_data)) {
+    if (retval = krb5_rd_priv(context, auth_context, &inbuf,
+                             &msg_data, &replaydata)) {
         fprintf(stderr, "Error during Second Read Decoding :%s!\n", 
                error_message(retval));
        free(inbuf.data);
@@ -207,16 +192,8 @@ kadm_add_user(context, my_creds, rep_ret, local_addr, foreign_addr,
 
 #endif /* MACH_PASS */
 
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                              ETYPE_DES_CBC_CRC,
-                              &my_creds->keyblock, 
-                              local_addr, 
-                              foreign_addr,
-                              *seqno,
-                              KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                              0,
-                              0,
-                              &msg_data))) {
+    if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                error_message(retval));
        free(inbuf.data);
@@ -238,15 +215,8 @@ kadm_add_user(context, my_creds, rep_ret, local_addr, foreign_addr,
         retval = 1;
     }
     
-    if ((retval = krb5_rd_priv(context, &inbuf,
-                              &my_creds->keyblock,
-                              foreign_addr,
-                              local_addr,
-                              rep_ret->seq_number,
-                              KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                              0,
-                              0,
-                              &msg_data))) {
+    if ((retval = krb5_rd_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Final Read Decoding :%s!\n",
                error_message(retval));
        free(inbuf.data);
index 7f9d75b0ea28c7494faa5f812c4a12b5329dc20b..52a8d3f73ea485c712a8099d7e48912d1af4044b 100644 (file)
 #include <netinet/in.h>
 #include <netdb.h>
 #include <string.h>
-#include "com_err.h"
+#include <com_err.h>
+
 #include <sys/param.h>
-#include "k5-int.h"
+
+#include <krb5.h>
 
 void decode_kadmind_reply();
 int print_status_message();
 
 krb5_error_code
-kadm_add_user_rnd(context, my_creds, rep_ret, local_addr, foreign_addr
+kadm_add_user_rnd(context, auth_context, my_creds
                  local_socket, seqno, principal)
     krb5_context context;
-    krb5_creds *my_creds;
-    krb5_ap_rep_enc_part *rep_ret;
-    krb5_address *local_addr, *foreign_addr;
+    krb5_auth_context *auth_context;
     int *local_socket;
     krb5_int32 *seqno;
     char *principal;
@@ -48,6 +48,7 @@ kadm_add_user_rnd(context, my_creds, rep_ret, local_addr, foreign_addr,
     kadmin_requests rd_priv_resp;
     char username[755];
     int count;
+    krb5_replay_data replaydata;
     krb5_error_code retval;     /* return code */
     
     if ((inbuf.data = (char *) calloc(1, 3 + sizeof(username))) == (char *) 0) {
@@ -83,16 +84,8 @@ kadm_add_user_rnd(context, my_creds, rep_ret, local_addr, foreign_addr,
     (void) memcpy( inbuf.data + 3, username, strlen(username));
     inbuf.length = strlen(username) + 3;
     
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                              ETYPE_DES_CBC_CRC,
-                              &my_creds->keyblock, 
-                              local_addr, 
-                              foreign_addr,
-                              *seqno,
-                              KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                              0,
-                              0,
-                              &msg_data))) {
+    if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                error_message(retval));
        free(inbuf.data);
@@ -115,15 +108,8 @@ kadm_add_user_rnd(context, my_creds, rep_ret, local_addr, foreign_addr,
         retval = 1;
     }
     
-    if ((retval = krb5_rd_priv(context, &inbuf,
-                              &my_creds->keyblock,
-                              foreign_addr,
-                              local_addr,
-                              rep_ret->seq_number,
-                              KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                              0,
-                              0,
-                              &msg_data))) {
+    if ((retval = krb5_rd_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Final Read Decoding :%s!\n",
                error_message(retval));
        free(inbuf.data);
index fec738ebd3ed9f1f681cadd3c1a2b63cee92b7c3..d938ff3f5a59040de2cf10d32bad5a3a9b0db264 100644 (file)
 #include <netdb.h>
 #include <signal.h>
 #include <string.h>
-#include "com_err.h"
+#include <com_err.h>
 
 #include <sys/param.h>
 
-#include "k5-int.h"
+#include <krb5.h>
 
 void decode_kadmind_reply();
 int print_status_message();
 
 krb5_error_code
-kadm_cpw_user_rnd(context, my_creds, rep_ret, local_addr, foreign_addr
+kadm_cpw_user_rnd(context, auth_context, my_creds
                  local_socket, seqno, principal)
     krb5_context context;
-    krb5_creds *my_creds;
-    krb5_ap_rep_enc_part *rep_ret;
-    krb5_address *local_addr, *foreign_addr;
+    krb5_auth_context *auth_context;
     int *local_socket;
     krb5_int32 *seqno;
     char *principal;
@@ -51,6 +49,7 @@ kadm_cpw_user_rnd(context, my_creds, rep_ret, local_addr, foreign_addr,
     kadmin_requests rd_priv_resp;
     char username[755];
     int count;
+    krb5_replay_data replaydata;
     krb5_error_code retval;     /* return code */
 
     if ((inbuf.data = (char *) calloc(1, 3 + sizeof(username))) == (char *) 0) {        fprintf(stderr, "No memory for command!\n");
@@ -86,16 +85,8 @@ kadm_cpw_user_rnd(context, my_creds, rep_ret, local_addr, foreign_addr,
     inbuf.length = strlen(username) + 3;
 
        /* Transmit Principal Name */
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                       ETYPE_DES_CBC_CRC,
-                       &my_creds->keyblock, 
-                       local_addr, 
-                       foreign_addr,
-                       *seqno,
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+    if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                        error_message(retval));
        free(inbuf.data);
@@ -117,15 +108,8 @@ kadm_cpw_user_rnd(context, my_creds, rep_ret, local_addr, foreign_addr,
         retval = 1;
     }
  
-    if ((retval = krb5_rd_priv(context, &inbuf,
-                        &my_creds->keyblock,
-                        foreign_addr,
-                        local_addr,
-                        rep_ret->seq_number,
-                        KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                        0,
-                        0,
-                        &msg_data))) {
+    if ((retval = krb5_rd_priv(context, auth_context, &inbuf,
+                                      &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Final Read Decoding :%s!\n",
                         error_message(retval));
         free(inbuf.data);
index 194e0f98b4fecb52c26d7927e92c2376bdb9ece5..34d39acba42451f6819432a3cd345e6a98a5f15b 100644 (file)
 #include <netdb.h>
 #include <signal.h>
 #include <string.h>
-#include "com_err.h"
+#include <com_err.h>
 
 #include <sys/param.h>
 
-#include "k5-int.h"
+#include <k5-int.h>
 
 void decode_kadmind_reply();
 int print_status_message();
 
 krb5_error_code
-kadm_cpw_user(context, my_creds, rep_ret, local_addr, foreign_addr
-             local_socket, seqno, oper_type, principal)
+kadm_cpw_user(context, auth_context, my_creds
+             local_socket, oper_type, principal)
     krb5_context context;
-    krb5_creds *my_creds;
-    krb5_ap_rep_enc_part *rep_ret;
-    krb5_address *local_addr, *foreign_addr;
+    krb5_auth_context *auth_context;
     int *local_socket;
-    krb5_int32 *seqno;
     int oper_type;
     char *principal;
 {
@@ -54,6 +51,7 @@ kadm_cpw_user(context, my_creds, rep_ret, local_addr, foreign_addr,
     char *password;
     int pwsize;
     int count;
+    krb5_replay_data replaydata;
     krb5_error_code retval;     /* return code */
 
     if ((inbuf.data = (char *) calloc(1, 3 + sizeof(username))) == (char *) 0) {        fprintf(stderr, "No memory for command!\n");
@@ -90,16 +88,8 @@ kadm_cpw_user(context, my_creds, rep_ret, local_addr, foreign_addr,
     inbuf.length = strlen(username) + 3;
 
        /* Transmit Principal Name */
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                       ETYPE_DES_CBC_CRC,
-                       &my_creds->keyblock, 
-                       local_addr, 
-                       foreign_addr,
-                       *seqno,
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+    if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                        error_message(retval));
        free(inbuf.data);
@@ -121,15 +111,8 @@ kadm_cpw_user(context, my_creds, rep_ret, local_addr, foreign_addr,
         return(1);
     }
 
-    if ((retval = krb5_rd_priv(context, &inbuf,
-                       &my_creds->keyblock,
-                       foreign_addr, 
-                       local_addr,
-                       rep_ret->seq_number, 
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+    if ((retval = krb5_rd_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Read Decoding :%s!\n", 
                        error_message(retval));
        free(inbuf.data);
@@ -219,16 +202,8 @@ kadm_cpw_user(context, my_creds, rep_ret, local_addr, foreign_addr,
 
 #endif /* MACH_PASS */
 
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                        ETYPE_DES_CBC_CRC,
-                        &my_creds->keyblock,
-                        local_addr,
-                        foreign_addr,
-                        *seqno,
-                        KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                        0,
-                        0,
-                        &msg_data))) {
+    if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                               &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                         error_message(retval));
        free(inbuf.data);
@@ -250,15 +225,8 @@ kadm_cpw_user(context, my_creds, rep_ret, local_addr, foreign_addr,
         retval = 1;
     }
  
-    if ((retval = krb5_rd_priv(context, &inbuf,
-                        &my_creds->keyblock,
-                        foreign_addr,
-                        local_addr,
-                        rep_ret->seq_number,
-                        KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                        0,
-                        0,
-                        &msg_data))) {
+    if ((retval = krb5_rd_priv(context, auth_context, &inbuf,
+                               &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Final Read Decoding :%s!\n",
                         error_message(retval));
         free(inbuf.data);
index be4c9a91dadb2f544da6d3b9ed206ffa44c3d9ce..16ccfdffbb54415dca917fb4b27507a5fa3354ee 100644 (file)
 #include <netinet/in.h>
 #include <netdb.h>
 #include <string.h>
-#include "com_err.h"
-#include "k5-int.h"
+#include <com_err.h>
+
+#include <krb5.h>
 
 void decode_kadmind_reply();
 int print_status_message();
 
 krb5_error_code
-kadm_del_user(context, my_creds, rep_ret, local_addr, foreign_addr, 
-             local_socket, seqno, principal)
+kadm_del_user(context, auth_context, my_creds, local_socket, principal)
     krb5_context context;
-    krb5_creds *my_creds;
-    krb5_ap_rep_enc_part *rep_ret;
-    krb5_address *local_addr, *foreign_addr;
+    krb5_auth_context *auth_context;
     int *local_socket;
-    krb5_int32 *seqno;
     char *principal;
 {
     krb5_data msg_data, inbuf;
     kadmin_requests rd_priv_resp;
     char username[755];
     int count;
+    krb5_replay_data replaydata;
     krb5_error_code retval;     /* return code */
 
     if ((inbuf.data = (char *) calloc(1, 3 + sizeof(username))) == (char *) 0) {
@@ -82,16 +80,8 @@ kadm_del_user(context, my_creds, rep_ret, local_addr, foreign_addr,
    (void) memcpy( inbuf.data + 3, username, strlen(username));
     inbuf.length = strlen(username) + 3;
 
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                       ETYPE_DES_CBC_CRC,
-                       &my_creds->keyblock, 
-                       local_addr, 
-                       foreign_addr,
-                       *seqno,
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+    if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                        error_message(retval));
         free(inbuf.data);
@@ -114,15 +104,8 @@ kadm_del_user(context, my_creds, rep_ret, local_addr, foreign_addr,
         return(1);
     }
 
-    if ((retval = krb5_rd_priv(context, &inbuf,
-                       &my_creds->keyblock,
-                       foreign_addr, 
-                       local_addr,
-                       rep_ret->seq_number, 
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+    if ((retval = krb5_rd_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Decoding :%s!\n", 
                        error_message(retval));
         return(1);
index a9585851dc5f1b75b094040c0518ec30c4cca781..6590096b09b601ef9ede5d57deb46b4495ba3d9e 100644 (file)
 #include <netinet/in.h>
 #include <netdb.h>
 #include <string.h>
-#include "com_err.h"
+#include <com_err.h>
 
-#include "k5-int.h"
+#include <krb5.h>
 
 krb5_error_code
-kadm_done(context, my_creds, rep_ret, local_addr, foreign_addr, 
-         local_socket, seqno)
+kadm_done(context, auth_context, my_creds, local_socket, seqno)
     krb5_context context;
-    krb5_creds *my_creds;
-    krb5_ap_rep_enc_part *rep_ret;
-    krb5_address *local_addr, *foreign_addr;
+    krb5_auth_context *auth_context;
     int *local_socket;
     krb5_int32 *seqno;
 {
+    krb5_replay_data replaydata;
     krb5_data msg_data, inbuf;
     krb5_error_code retval;     /* return code */
     char buf[16];
@@ -53,16 +51,8 @@ kadm_done(context, my_creds, rep_ret, local_addr, foreign_addr,
     (void) memset( inbuf.data + 4, 0, 4);
     inbuf.length = 16;
 
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                       ETYPE_DES_CBC_CRC,
-                       &my_creds->keyblock, 
-                       local_addr, 
-                       foreign_addr,
-                       *seqno,
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+    if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                        error_message(retval));
         return(1);
index aa46cadfec1ff33da92be52b1793a5ece372dfb2..55988cdb7074046ea13b166f5b0d6227ea16555f 100644 (file)
 #include <netdb.h>
 #include <signal.h>
 #include <string.h>
-#include "com_err.h"
+#include <com_err.h>
 
-#include "k5-int.h"
+#include <krb5.h>
 
 void decode_kadmind_reply();
 int print_status_message();
 
 krb5_error_code
-kadm_inq_user(context, my_creds, rep_ret, local_addr, foreign_addr, 
-             local_socket, seqno, principal)
+kadm_inq_user(context, auth_context, my_creds, local_socket, principal)
     krb5_context context;
-    krb5_creds *my_creds;
-    krb5_ap_rep_enc_part *rep_ret;
-    krb5_address *local_addr, *foreign_addr;
+    krb5_auth_context *auth_context;
     int *local_socket;
-    krb5_int32 *seqno;
     char *principal;
 {
+    krb5_replay_data replaydata;
     krb5_data msg_data, inbuf;
     kadmin_requests rd_priv_resp;
     char username[755];
@@ -85,16 +82,8 @@ kadm_inq_user(context, my_creds, rep_ret, local_addr, foreign_addr,
     (void) memcpy( inbuf.data + 3, username, strlen(username));
     inbuf.length = strlen(username) + 3;
  
-    if (retval = krb5_mk_priv(context, &inbuf,
-                       ETYPE_DES_CBC_CRC,
-                       &my_creds->keyblock, 
-                       local_addr, 
-                       foreign_addr,
-                       *seqno,
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data)) {
+    if (retval = krb5_mk_priv(context, auth_context, &inbuf,
+                             &msg_data, &replaydata)) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                        error_message(retval));
        free(inbuf.data);
@@ -116,15 +105,8 @@ kadm_inq_user(context, my_creds, rep_ret, local_addr, foreign_addr,
         return(1);
     }
 
-    if (retval = krb5_rd_priv(context, &inbuf,
-                       &my_creds->keyblock,
-                       foreign_addr, 
-                       local_addr,
-                       rep_ret->seq_number, 
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data)) {
+    if (retval = krb5_rd_priv(context, auth_context, &inbuf,
+                             &msg_data, &replaydata)) {
         fprintf(stderr, "Error during Second Read Decoding :%s!\n", 
                        error_message(retval));
        free(inbuf.data);
@@ -170,16 +152,8 @@ kadm_inq_user(context, my_creds, rep_ret, local_addr, foreign_addr,
     inbuf.data[1] = KADMGOOD;
     inbuf.length = 2;
  
-    if (retval = krb5_mk_priv(context, &inbuf,
-                        ETYPE_DES_CBC_CRC,
-                        &my_creds->keyblock,
-                        local_addr,
-                        foreign_addr,
-                        *seqno,
-                        KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                        0,
-                        0,
-                        &msg_data)) {
+    if (retval = krb5_mk_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata)) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                         error_message(retval));
        free(inbuf.data);
@@ -202,15 +176,8 @@ kadm_inq_user(context, my_creds, rep_ret, local_addr, foreign_addr,
         retval = 1;
     }
  
-    if (retval = krb5_rd_priv(context, &inbuf,
-                        &my_creds->keyblock,
-                        foreign_addr,
-                        local_addr,
-                        rep_ret->seq_number,
-                        KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                        0,
-                        0,
-                        &msg_data)) {
+    if (retval = krb5_rd_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata)) {
         fprintf(stderr, "Error during Final Read Decoding :%s!\n",
                         error_message(retval));
         free(inbuf.data);
index d955e27aed4d5faa18e6997363c82d7e2241c2d4..88105281e626a3d82022090fe4d12044b418ce6c 100644 (file)
 #include <netdb.h>
 #include <signal.h>
 #include <string.h>
-#include "k5-int.h"
-#include "com_err.h"
+#include <com_err.h>
+
+#include <krb5.h>
 
 void decode_kadmind_reply();
 int print_status_message();
 
 krb5_error_code
-kadm_mod_user(context, my_creds, rep_ret, local_addr, foreign_addr, 
-             local_socket, seqno, principal)
+kadm_mod_user(context, auth_context, my_creds, local_socket, principal)
     krb5_context context;
+    krb5_auth_context *auth_context;
     krb5_creds *my_creds;
-    krb5_ap_rep_enc_part *rep_ret;
-    krb5_address *local_addr, *foreign_addr;
     int *local_socket;
-    krb5_int32 *seqno;
     char *principal;
 {
     krb5_data msg_data, inbuf;
     kadmin_requests rd_priv_resp;
     char username[755];
     int count;
+    krb5_replay_data replaydata;
     krb5_error_code retval;     /* return code */
 
     if ((inbuf.data = (char *) calloc(1, 3 + sizeof(username))) == (char *) 0) {        fprintf(stderr, "No memory for command!\n");
@@ -82,16 +81,8 @@ kadm_mod_user(context, my_creds, rep_ret, local_addr, foreign_addr,
     (void) memcpy( inbuf.data + 3, username, strlen(username));
     inbuf.length = strlen(username) + 3;
  
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                       ETYPE_DES_CBC_CRC,
-                       &my_creds->keyblock, 
-                       local_addr, 
-                       foreign_addr,
-                       *seqno,
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+    if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                        error_message(retval));
        free(inbuf.data);
@@ -113,15 +104,8 @@ kadm_mod_user(context, my_creds, rep_ret, local_addr, foreign_addr,
         return(1);
     }
 
-    if ((retval = krb5_rd_priv(context, &inbuf,
-                       &my_creds->keyblock,
-                       foreign_addr, 
-                       local_addr,
-                       rep_ret->seq_number, 
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+    if ((retval = krb5_rd_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Read Decoding :%s!\n", 
                        error_message(retval));
         free(inbuf.data);
@@ -142,8 +126,7 @@ kadm_mod_user(context, my_creds, rep_ret, local_addr, foreign_addr,
     }
     free(msg_data.data);
 
-    kadm_snd_mod(my_creds, rep_ret, local_addr, 
-                       foreign_addr, local_socket, seqno);
+    kadm_snd_mod(context, auth_context, my_creds, local_socket);
 
     if ((inbuf.data = (char *) calloc(1, 2)) == (char *) 0) {
         fprintf(stderr, "No memory for command!\n");
@@ -156,16 +139,8 @@ kadm_mod_user(context, my_creds, rep_ret, local_addr, foreign_addr,
     inbuf.data[2] = SENDDATA3;
     inbuf.length = 3;
  
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                        ETYPE_DES_CBC_CRC,
-                        &my_creds->keyblock,
-                        local_addr,
-                        foreign_addr,
-                        *seqno,
-                        KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                        0,
-                        0,
-                        &msg_data))) {
+    if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                               &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                         error_message(retval));
        free(inbuf.data);
@@ -188,15 +163,8 @@ kadm_mod_user(context, my_creds, rep_ret, local_addr, foreign_addr,
         retval = 1;
     }
 
-    if ((retval = krb5_rd_priv(context, &inbuf,
-                        &my_creds->keyblock,
-                        foreign_addr,
-                        local_addr,
-                        rep_ret->seq_number,
-                        KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                        0,
-                        0,
-                        &msg_data))) {
+    if ((retval = krb5_rd_priv(context, auth_context, &inbuf,
+                               &msg_data, &replaydata))) {
         fprintf(stderr, "Error during Final Read Decoding :%s!\n",
                         error_message(retval));
        free(inbuf.data);
index c106e284136ac96b20825e94c1750bb2866897e7..7fc626de14d70947633af0ba56db67f699764b91 100644 (file)
 #include <netdb.h>
 #include <signal.h>
 #include <string.h>
-#include "com_err.h"
+#include <com_err.h>
 
 #include <sys/param.h>
 #include <pwd.h>
 
 #include <sys/stat.h>
 
-#include "k5-int.h"
+#include <krb5.h>
 
 #ifndef MAXPATHLEN
 #define MAXPATHLEN 1024
 #endif
 
 krb5_error_code
-kadm_snd_mod(context, my_creds, rep_ret, local_addr, foreign_addr, 
-            local_socket, seqno)
+kadm_snd_mod(context, auth_context, my_creds, local_socket)
     krb5_context context;
+    krb5_auth_context *auth_context;
     krb5_creds *my_creds;
-    krb5_ap_rep_enc_part *rep_ret;
-    krb5_address *local_addr, *foreign_addr;
     int *local_socket;
-    krb5_int32 *seqno;
 {
+    krb5_replay_data replaydata;
     krb5_error_code retval;     /* return code */
     krb5_data msg_data, inbuf;
     char mod_type[10];
@@ -210,16 +208,8 @@ repeat3:
        inbuf.data[1] = MODOPER;
        inbuf.data[2] = SENDDATA3;
 
-       if ((retval = krb5_mk_priv(context, &inbuf,
-                       ETYPE_DES_CBC_CRC,
-                       &my_creds->keyblock, 
-                       local_addr, 
-                       foreign_addr,
-                       *seqno,
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+       if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                                  &msg_data, &replaydata))) {
             fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                        error_message(retval));
            free(inbuf.data);
@@ -241,15 +231,8 @@ repeat3:
             return(1);
        }
 
-       if ((retval = krb5_rd_priv(context, &inbuf,
-                       &my_creds->keyblock,
-                        foreign_addr,
-                        local_addr,
-                        rep_ret->seq_number,
-                        KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                        0,
-                        0,
-                        &msg_data))) {
+       if ((retval = krb5_rd_priv(context, auth_context, &inbuf,
+                                  &msg_data, &replaydata))) {
             fprintf(stderr, "Error during Second Read Decoding :%s!\n",
                         error_message(retval));
             free(inbuf.data);
@@ -269,16 +252,8 @@ alldone:
     inbuf.data[2] = SENDDATA3;
     inbuf.length = 3;
 
-    if ((retval = krb5_mk_priv(context, &inbuf,
-                       ETYPE_DES_CBC_CRC,
-                       &my_creds->keyblock, 
-                       local_addr, 
-                       foreign_addr,
-                       *seqno,
-                       KRB5_PRIV_DOSEQUENCE|KRB5_PRIV_NOTIME,
-                       0,
-                       0,
-                       &msg_data))) {
+    if ((retval = krb5_mk_priv(context, auth_context, &inbuf,
+                              &msg_data, &replaydata))) {
        fprintf(stderr, "Error during Second Message Encoding: %s!\n",
                        error_message(retval));
        free(inbuf.data);