Added support for KRB5_CRED message
authorTheodore Tso <tytso@mit.edu>
Thu, 3 Jun 1993 00:08:25 +0000 (00:08 +0000)
committerTheodore Tso <tytso@mit.edu>
Thu, 3 Jun 1993 00:08:25 +0000 (00:08 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2548 dc483132-0cff-0310-8789-dd5450dbe970

src/include/krb5/asn.1/asn1defs.h
src/include/krb5/asn.1/encode.h

index 57fbb516a8f92b6c7455e842cfd25117f29dba76..3702a8c29b7d02f94bd2f332d81bbc9d17d0514a 100644 (file)
@@ -164,6 +164,10 @@ struct type_KRB5_LastReq *krb5_last_req2KRB5_LastReq
 struct type_KRB5_EncKrbPrivPart *krb5_priv_enc_part2KRB5_EncKrbPrivPart
        PROTOTYPE((const krb5_priv_enc_part *, int *));
 
+/* kcrep2crep.c */
+struct type_KRB5_EncKrbCredPart *krb5_cred_enc_part2KRB5_EncKrbCredPart
+       PROTOTYPE((const krb5_cred_enc_part *, int *));
+
 /* kprin2prin.c */
 struct type_KRB5_PrincipalName *krb5_principal2KRB5_PrincipalName
        PROTOTYPE((krb5_const_principal , int *));
@@ -172,6 +176,10 @@ struct type_KRB5_PrincipalName *krb5_principal2KRB5_PrincipalName
 struct type_KRB5_KRB__PRIV *krb5_priv2KRB5_KRB__PRIV
        PROTOTYPE((const krb5_priv *, int *));
 
+/* kcred2cred.c */
+struct type_KRB5_KRB__CRED *krb5_cred2KRB5_KRB__CRED
+       PROTOTYPE((const krb5_cred *, int *));
+
 /* Sandia Passwd Utilities */
 /* kpwds2pwds.c */
 struct type_KRB5_PasswdData *krb5_pwd_data2KRB5_PWD__DATA
@@ -208,6 +216,10 @@ krb5_last_req_entry **KRB5_LastReq2krb5_last_req
 krb5_priv_enc_part *KRB5_EncKrbPrivPart2krb5_priv_enc_part
        PROTOTYPE((const struct type_KRB5_EncKrbPrivPart *, int *));
 
+/* crep2kcrep.c */
+krb5_cred_enc_part *KRB5_EncKrbCredPart2krb5_cred_enc_part
+       PROTOTYPE((const struct type_KRB5_EncKrbCredPart *, int *));
+
 /* prin2kprin.c */
 krb5_principal KRB5_PrincipalName2krb5_principal
        PROTOTYPE((const struct type_KRB5_PrincipalName *, const struct type_KRB5_Realm *, int *));
@@ -216,6 +228,10 @@ krb5_principal KRB5_PrincipalName2krb5_principal
 krb5_priv *KRB5_KRB__PRIV2krb5_priv
        PROTOTYPE((const struct type_KRB5_KRB__PRIV *, int *));
 
+/* cred2kcred.c */
+krb5_cred *KRB5_KRB__CRED2krb5_cred
+       PROTOTYPE((const struct type_KRB5_KRB__CRED *, int *));
+
 /* Sandia passwd utilities */
 /* pwds2kpwds.c */
 krb5_pwd_data *KRB5_PWD__DATA2krb5_pwd_data
index f7cf3e92a3147b669354226db9155831785c8765..a84cd4318a91eb7e0157a9996c233a58c6ab2d6b 100644 (file)
@@ -71,6 +71,17 @@ krb5_error_code krb5_decode_generic
                   (translator_func) KRB5_Ticket2krb5_ticket, \
                   (free_func) free_KRB5_Ticket)
 
+#define encode_krb5_encryption_key(ptick, output) \
+    krb5_encode_generic((krb5_const_pointer)ptick,  output, \
+                  (encoder_func) encode_KRB5_EncryptionKey, \
+                  (translator_func) krb5_keyblock2KRB5_EncryptionKey, \
+                  (free_func) free_KRB5_EncryptionKey)
+#define decode_krb5_encryption_key(ptick, output) \
+    krb5_decode_generic((krb5_const_pointer)ptick,  output, \
+                  (decoder_func) decode_KRB5_EncryptionKey, \
+                  (translator_func) KRB5_EncryptionKey2krb5_keyblock, \
+                  (free_func) free_KRB5_EncryptionKey)
+
 #define encode_krb5_enc_tkt_part(ptick, output) \
     krb5_encode_generic((krb5_const_pointer)ptick,  output, \
                   (encoder_func) encode_KRB5_EncTicketPart, \
@@ -216,6 +227,28 @@ krb5_error_code krb5_decode_generic
                   (translator_func) KRB5_EncKrbPrivPart2krb5_priv_enc_part, \
                   (free_func) free_KRB5_EncKrbPrivPart)
 
+#define encode_krb5_cred(req, output) \
+    krb5_encode_generic((krb5_const_pointer)req, output, \
+                  (encoder_func) encode_KRB5_KRB__CRED, \
+                  (translator_func) krb5_cred2KRB5_KRB__CRED, \
+                  (free_func) free_KRB5_KRB__CRED)
+#define decode_krb5_cred(req, output) \
+    krb5_decode_generic(req, (krb5_pointer *) output, \
+                  (decoder_func) decode_KRB5_KRB__CRED, \
+                  (translator_func) KRB5_KRB__CRED2krb5_cred, \
+                  (free_func) free_KRB5_KRB__CRED)
+
+#define encode_krb5_enc_cred_part(req, output) \
+    krb5_encode_generic((krb5_const_pointer)req, output, \
+                  (encoder_func) encode_KRB5_EncKrbCredPart, \
+                  (translator_func) krb5_cred_enc_part2KRB5_EncKrbCredPart, \
+                  (free_func) free_KRB5_EncKrbCredPart)
+#define decode_krb5_enc_cred_part(req, output) \
+    krb5_decode_generic(req, (krb5_pointer *) output, \
+                  (decoder_func) decode_KRB5_EncKrbCredPart, \
+                  (translator_func) KRB5_EncKrbCredPart2krb5_cred_enc_part, \
+                  (free_func) free_KRB5_EncKrbCredPart)
+
 #define encode_krb5_error(req, output) \
     krb5_encode_generic((krb5_const_pointer)req, output, \
                   (encoder_func) encode_KRB5_KRB__ERROR, \
@@ -274,10 +307,12 @@ krb5_error_code krb5_decode_generic
   AP_REP is APPLICATION 15.
   KRB_SAFE is APPLICATION 20.
   KRB_PRIV is APPLICATION 21.
+  KRB_CRED is APPLICATION 22.
   EncASRepPart is APPLICATION 25.
   EncTGSRepPart is APPLICATION 26.
   EncAPRepPart is APPLICATION 27.
   EncKrbPrivPart is APPLICATION 28.
+  EncKrbCredPart is APPLICATION 29.
   KRB_ERROR is APPLICATION 30.
  */
 /* allow either constructed or primitive encoding, so check for bit 6
@@ -312,6 +347,9 @@ krb5_error_code krb5_decode_generic
 #define krb5_is_krb_priv(dat)\
        ((dat) && (dat)->length && ((dat)->data[0] == 0x75 ||\
                                    (dat)->data[0] == 0x55))
+#define krb5_is_krb_cred(dat)\
+       ((dat) && (dat)->length && ((dat)->data[0] == 0x76 ||\
+                                   (dat)->data[0] == 0x56))
 #define krb5_is_krb_enc_as_rep_part(dat)\
        ((dat) && (dat)->length && ((dat)->data[0] == 0x79 ||\
                                    (dat)->data[0] == 0x59))
@@ -324,6 +362,9 @@ krb5_error_code krb5_decode_generic
 #define krb5_is_krb_enc_krb_priv_part(dat)\
        ((dat) && (dat)->length && ((dat)->data[0] == 0x7c ||\
                                    (dat)->data[0] == 0x5c))
+#define krb5_is_krb_enc_krb_cred_part(dat)\
+       ((dat) && (dat)->length && ((dat)->data[0] == 0x7d ||\
+                                   (dat)->data[0] == 0x5d))
 #define krb5_is_krb_error(dat)\
        ((dat) && (dat)->length && ((dat)->data[0] == 0x7e ||\
                                    (dat)->data[0] == 0x5e))