Added an extra argument to mk_req_ext so that the caller can get a
authorTheodore Tso <tytso@mit.edu>
Wed, 10 Oct 1990 17:16:21 +0000 (17:16 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 10 Oct 1990 17:16:21 +0000 (17:16 +0000)
copy of the authenticator which was used to build up the AP_REQ message.

Also took out a cast because cmsec was changed to be signed.

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

src/lib/krb5/krb/mk_req_ext.c

index a2624e8c36f21fab4c01d1dcbe95dfd64a3a81f9..220f829e131a3445efb975494a7cb5baeda919f3 100644 (file)
@@ -58,13 +58,14 @@ static krb5_error_code generate_authenticator PROTOTYPE((krb5_authenticator *,
 
 krb5_error_code
 krb5_mk_req_extended(ap_req_options, checksum, times, kdc_options, ccache,
-                    creds, outbuf)
+                    creds, authentp, outbuf)
 const krb5_flags ap_req_options;
 const krb5_checksum *checksum;
 const krb5_ticket_times *times;
 const krb5_flags kdc_options;
 krb5_ccache ccache;
 krb5_creds *creds;
+krb5_authenticator *authentp;
 krb5_data *outbuf;
 {
     krb5_error_code retval;
@@ -106,6 +107,15 @@ krb5_data *outbuf;
        cleanup_ticket();
        return retval;
     }
+    if (authentp) {
+           *authentp = authent;
+           /* Null out these fields, to prevent pointer sharing problems 
+            * The caller won't need these fields anyway, since they were
+            * supplied by the caller
+            */
+           authentp->client = NULL;
+           authentp->checksum = NULL; 
+    }
     /* encode it before encrypting */
     retval = encode_krb5_authenticator(&authent, &scratch);
     if (retval) {
@@ -187,7 +197,5 @@ const krb5_checksum *cksum;
     authent->client = creds->client;
     authent->checksum = (krb5_checksum *)cksum;
 
-    /* cmsec is unsigned, time is signed, hence the cast */
-    return(krb5_ms_timeofday(&authent->ctime, 
-                            (krb5_int16 *)&authent->cmsec));
+    return(krb5_ms_timeofday(&authent->ctime, &authent->cmsec));
 }