remove kdc_input_mkey
authorJohn Kohl <jtkohl@mit.edu>
Wed, 7 Feb 1990 17:46:11 +0000 (17:46 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Wed, 7 Feb 1990 17:46:11 +0000 (17:46 +0000)
change isset to isflagset; change set to setflag

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

src/kdc/kdc_util.c
src/kdc/kdc_util.h

index 561ba0e6483f9b59b4492139a7f7dad1f7617788..bafe40ea8e5fabfe8723f275892d8cdce41cd1b3 100644 (file)
@@ -20,6 +20,7 @@ static char rcsid_kdc_util_c[] =
 #include <krb5/kdb.h>
 #include <krb5/krb5_err.h>
 #include <krb5/kdb5_err.h>
+#include <krb5/asn1.h>
 
 #include "kdc_util.h"
 #include "extern.h"
@@ -95,29 +96,29 @@ krb5_fulladdr *from;
     if (retval = kdc_process_tgs_req(tgs_req, from))
        return(retval);
 
-    if (tgs_req->enc_part.length) {
+    if (tgs_req->tgs_request2->enc_part.length) {
        /* decrypt encrypted part, attach to enc_part2 */
 
-       if (!valid_etype(tgs_req->etype)) /* XXX wrong etype to use? */
+       if (!valid_etype(tgs_req->tgs_request2->etype)) /* XXX wrong etype to use? */
            return KRB5KDC_ERR_ETYPE_NOSUPP;
 
-       scratch.length = tgs_req->enc_part.length;
-       if (!(scratch.data = malloc(tgs_req->enc_part.length))) {
+       scratch.length = tgs_req->tgs_request2->enc_part.length;
+       if (!(scratch.data = malloc(tgs_req->tgs_request2->enc_part.length))) {
            return(ENOMEM);
        }
        /* put together an eblock for this encryption */
 
-       eblock.crypto_entry = krb5_csarray[tgs_req->etype]->system; /* XXX */
+       eblock.crypto_entry = krb5_csarray[tgs_req->tgs_request2->etype]->system; /* XXX */
        /* do any necessary key pre-processing */
        if (retval = (*eblock.crypto_entry->process_key)(&eblock,
-                                                        tgs_req->header->ticket->enc_part2->session)) {
+                                                        tgs_req->header2->ticket->enc_part2->session)) {
            free(scratch.data);
            return(retval);
        }
 
        /* call the encryption routine */
        if (retval =
-           (*eblock.crypto_entry->decrypt_func)((krb5_pointer) tgs_req->enc_part.data,
+           (*eblock.crypto_entry->decrypt_func)((krb5_pointer) tgs_req->tgs_request2->enc_part.data,
                                                 (krb5_pointer) scratch.data,
                                                 scratch.length, &eblock)) {
            (void) (*eblock.crypto_entry->finish_key)(&eblock);
@@ -138,7 +139,7 @@ krb5_fulladdr *from;
        clean_scratch();
 #undef clean_scratch
 
-       tgs_req->enc_part2 = local_encpart;
+       tgs_req->tgs_request2->enc_part2 = local_encpart;
     }
     return 0;
 }
@@ -166,10 +167,10 @@ krb5_keyblock **key;
        return ENOMEM;
     *newkey = *whoisit->key;
     if (!(newkey->contents = (krb5_octet *)malloc(newkey->length))) {
-       free(newkey);
+       free((char *)newkey);
        return ENOMEM;
     }
-    bcopy(whoisit->key, newkey->contents, newkey->length);
+    bcopy((char *)whoisit->key, (char *)newkey->contents, newkey->length);
     *key = newkey;
     return 0;
 }
@@ -180,7 +181,7 @@ kdc_process_tgs_req(request, from)
 krb5_tgs_req *request;
 krb5_fulladdr *from;
 {
-    register krb5_ap_req *apreq = request->header;
+    register krb5_ap_req *apreq = request->header2;
     int nprincs;
     krb5_boolean more;
     krb5_db_entry server;
@@ -190,8 +191,8 @@ krb5_fulladdr *from;
     krb5_error_code retval;
     krb5_checksum our_cksum;
 
-    if (isset(apreq->ap_options, AP_OPTS_USE_SESSION_KEY) ||
-       isset(apreq->ap_options, AP_OPTS_MUTUAL_REQUIRED))
+    if (isflagset(apreq->ap_options, AP_OPTS_USE_SESSION_KEY) ||
+       isflagset(apreq->ap_options, AP_OPTS_MUTUAL_REQUIRED))
        return KRB5KDC_ERR_POLICY;
 
     /* XXX perhaps we should optimize the case of the TGS ? */
@@ -281,32 +282,3 @@ int direction;
        return KRB5_KDB_ILLDIRECTION;
 }
 
-/*
- * get the master key from somewhere, filling it into *key.
- *
- * key->keytype should be set to the desired type.
- *
- */
-
-krb5_error_code
-kdc_input_mkey(mname, key)
-krb5_principal mname;
-krb5_keyblock *key;
-{
-    krb5_error_code retval;
-    char password[BUFSIZ];
-    krb5_data pwd;
-    int size = sizeof(password);
-
-    /* XXX need a way to read from file */
-    if (retval = krb5_read_password(krb5_mkey_pwd_prompt1,
-                                   krb5_mkey_pwd_prompt2,
-                                   password,
-                                   &size))
-       return(retval);
-
-    return (*master_encblock.crypto_entry->string_to_key)(key->keytype,
-                                                         key,
-                                                         &pwd,
-                                                         mname);
-}
index 79e752157d9435a447d2a85e715dd754ec37f107..267922ae445f118eb2a7df9f44a76d86a74a267a 100644 (file)
@@ -52,8 +52,8 @@ void closedown_network PROTOTYPE((void));
 #define CONVERT_INTO_DB        0
 #define CONVERT_OUTOF_DB 1
 
-#define isset(flagfield, flag) (flagfield & (flag))
-#define set(flagfield, flag) (flagfield |= (flag))
+#define isflagset(flagfield, flag) (flagfield & (flag))
+#define setflag(flagfield, flag) (flagfield |= (flag))
 #define clear(flagfield, flag) (flagfield &= ~(flag))
 
 #define realm_of_tgt(ticket) ((ticket)->server[0])