* kpasswd.c Call krb5_sendauth(), krb5_get_credentials()
authorChris Provenzano <proven@mit.edu>
Thu, 23 Feb 1995 13:28:20 +0000 (13:28 +0000)
committerChris Provenzano <proven@mit.edu>
Thu, 23 Feb 1995 13:28:20 +0000 (13:28 +0000)
   with new calling convention.

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

src/kadmin/kpasswd/ChangeLog
src/kadmin/kpasswd/kpasswd.c

index 52aa1b5d9e68ceb56c321add3b77fe77f52e6308..7895ab962f41e35333f09935811aabfac70ff558 100644 (file)
@@ -1,3 +1,8 @@
+Tue Feb 14 15:30:55 1995 Chris Provenzano  (proven@mit.edu)
+
+        * kpasswd.c Call krb5_sendauth(), krb5_get_credentials()
+               with new calling convention.
+
 Fri Feb 10 17:48:05 1995  Theodore Y. Ts'o  <tytso@dcl>
 
        * kpasswd.c: Don't include <krb5/asn.1/encode.h>; use <krb5/asn1.h>.
index cecacf935691e21e3ed3410eed661290c0b4ca63..b5db1028f67a171eb264caa9a1e06ef0ef24413a 100644 (file)
@@ -67,14 +67,14 @@ static krb5_error_code adm5_init_link
 static krb5_error_code get_first_ticket 
        PROTOTYPE((krb5_context,
                   krb5_ccache, 
-                  krb5_principal));
+                  krb5_principal,
+                  krb5_creds *));
 
 krb5_error_code print_and_choose_password 
        PROTOTYPE((char *, krb5_data *));
 
 struct sockaddr_in local_sin, remote_sin;
 
-krb5_creds my_creds;
 
 extern char *krb5_default_pwd_prompt1;
 
@@ -114,6 +114,7 @@ main(argc,argv)
     krb5_data msg_data, inbuf;
     krb5_int32 seqno;
 
+    krb5_creds my_creds, * new_creds;
     char *new_password;
     int new_pwsize;
 
@@ -273,7 +274,7 @@ main(argc,argv)
  *     Verify User by Obtaining Initial Credentials prior to Initial Link
  */
 
-    if ((retval = get_first_ticket(context, cache, client))) {
+    if ((retval = get_first_ticket(context, cache, client, &my_creds))) {
        goto finish;
     }
     
@@ -343,14 +344,15 @@ main(argc,argv)
                        &seqno, 
                        0,           /* don't need a subsession key */
                        &err_ret,
-                       &rep_ret))) {
+                       &rep_ret, NULL))) {
        fprintf(stderr, "Error while performing sendauth: %s!\n",
                        error_message(retval));
         goto finish;
     }
 
     /* Get credentials : to use for safe and private messages */
-    if (retval = krb5_get_credentials(context, 0, cache, &my_creds)){
+    /* No need to pass my_creds because it's uninizialized. */
+    if (retval = krb5_get_credentials(context,0,cache,&my_creds,&new_creds)){
        fprintf(stderr, "Error Obtaining Credentials: %s!\n", 
                error_message(retval));
        goto finish;
@@ -375,7 +377,7 @@ main(argc,argv)
 
     if ((retval = krb5_mk_priv(context, &inbuf,
                        ETYPE_DES_CBC_CRC,
-                       &my_creds.keyblock, 
+                       &new_creds->keyblock, 
                        &local_addr, 
                        &foreign_addr,
                        seqno,
@@ -407,7 +409,7 @@ main(argc,argv)
     }
 
     if ((retval = krb5_rd_priv(context, &inbuf,
-                       &my_creds.keyblock,
+                       &new_creds->keyblock,
                        &foreign_addr, 
                        &local_addr,
                        rep_ret->seq_number, 
@@ -461,7 +463,7 @@ main(argc,argv)
 
     if ((retval = krb5_mk_priv(context, &inbuf,
                        ETYPE_DES_CBC_CRC,
-                       &my_creds.keyblock, 
+                       &new_creds->keyblock, 
                        &local_addr, 
                        &foreign_addr,
                        seqno,
@@ -493,7 +495,7 @@ main(argc,argv)
     }
 
     if ((retval = krb5_rd_priv(context, &inbuf,
-                       &my_creds.keyblock,
+                       &new_creds->keyblock,
                        &foreign_addr, 
                        &local_addr,
                        rep_ret->seq_number, 
@@ -566,10 +568,11 @@ krb5_data cpwname = {
 };
 
 static krb5_error_code
-get_first_ticket(context, cache, client)
+get_first_ticket(context, cache, client, my_creds)
     krb5_context context;
     krb5_ccache cache;
     krb5_principal client;
+    krb5_creds *my_creds;
 {
     char prompt[255];                  /* for the password prompt */
     char pword[ADM_MAX_PW_LENGTH+1];   /* storage for the password */
@@ -594,11 +597,11 @@ get_first_ticket(context, cache, client)
        return(1);
     }
 
-    memset((char *) &my_creds, 0, sizeof(my_creds));
+    memset((char *) my_creds, 0, sizeof(krb5_creds));
 
-    my_creds.client = client;                           
+    my_creds->client = client;                           
  
-    if ((retval = krb5_build_principal_ext(context, &my_creds.server,
+    if ((retval = krb5_build_principal_ext(context, &my_creds->server,
                                         client->realm.length, 
                                        client->realm.data,
                                         cpwname.length,                /* 6 */ 
@@ -633,7 +636,7 @@ get_first_ticket(context, cache, client)
                                        my_addresses, 
                                        NULL, /* Default encryption list */
                                         NULL, /* Default preauth list */
-                                       old_password, cache, &my_creds, 0);
+                                       old_password, cache, my_creds, 0);
        
     if (retval) {
        fprintf(stderr, "\nUnable to Get Initial Credentials : %s %d\n",