From: John Kohl Date: Tue, 21 Nov 1989 16:11:29 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: krb5-1.0-alpha2~1347 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=76538682d163ac6f127f28e855ee01493771fd90;p=krb5.git *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@26 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/krb5/base-defs.h b/src/include/krb5/base-defs.h new file mode 100644 index 000000000..1556452c0 --- /dev/null +++ b/src/include/krb5/base-defs.h @@ -0,0 +1,36 @@ +/* + * $Source$ + * $Author$ + * $Id$ + * + * Copyright 1989 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * <<< Description >>> + */ + +#include + +#ifndef __KRB5_TYPEDEFS__ +#define __KRB5_TYPEDEFS__ + +#include + +typedef octet krb5_ui_1; +typedef int16 krb5_ui_2; +typedef int32 krb5_ui_4; + +typedef int32 krb5_timestamp; +typedef krb5_ui_2 confounder; +typedef octet krb5_msgtype; +typedef octet krb5_kvno; +typedef int32 krb5_flags; + +typedef krb5_ui_2 krb5_addr_type; +typedef krb5_ui_2 krb5_keytype; +typedef krb5_ui_2 krb5_enctype; +typedef krb5_ui_2 krb5_cksumtype; + +#endif /* __KRB5_TYPEDEFS__ */ diff --git a/src/include/krb5/crc-32.h b/src/include/krb5/crc-32.h new file mode 100644 index 000000000..9b72b0593 --- /dev/null +++ b/src/include/krb5/crc-32.h @@ -0,0 +1,21 @@ +/* + * $Source$ + * $Author$ + * $Id$ + * + * Copyright 1989 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Definitions for the CRC-32 checksum + */ + +#include + +#ifndef __KRB5_CRC32__ +#define __KRB5_CRC32__ + +#define CRC32_CKSUMTYPE 1 + +#endif /* __KRB5_CRC32__ */ diff --git a/src/include/krb5/encryption.h b/src/include/krb5/encryption.h new file mode 100644 index 000000000..b9769265a --- /dev/null +++ b/src/include/krb5/encryption.h @@ -0,0 +1,72 @@ +/* + * $Source$ + * $Author$ + * $Id$ + * + * Copyright 1989 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * Encryption interface-related declarations + */ + +#include + +#ifndef __KRB5_ENCRYPTION__ +#define __KRB5_ENCRYPTION__ + +typedef struct _krb5_keyblock { + krb5_keytype keytype; + int length; + octet contents[1]; /* actually can be more, depending + on length */ +} krb5_keyblock; + +/* could be used in a table to find an etype and initialize a block */ +typedef struct _krb5_cryptosystem_entry { + int (*encrypt_func)(/* void *in, void *out, krb5_keyblock *key, + void *private */); + int (*decrypt_func)(/* void *in, void *out, krb5_keyblock *key, + void *private */); + int (*process_key)(/* krb5_encrypt_block *block, krb5_keyblock *key */); + int block_length; + int pad_minimum; /* needed for cksum size computation */ + int keysize; +} krb5_cryptosystem_entry; + +typedef struct _krb5_encrypt_block { + krb5_cryptosystem_entry crypto_entry; + krb5_keyblock key; + void *private; /* for private use, e.g. DES + key schedules */ +} krb5_encrypt_block; + +#define efunc crypto_entry.encrypt_func +#define dfunc crypto_entry.decrypt_func +#define prkey crypto_entry.process_key +#define blength crypto_entry.block_length +#define padmin crypto_entry.pad_minimum +#define ksize crypto_entry.keysize + +/* per Kerberos v5 protocol spec */ +#define KEYTYPE_NULL 0x0000 +#define KEYTYPE_DES 0x0001 /* Data Encryption Standard, + FIPS 46,81 */ +#define KEYTYPE_LUCIFER 0x0002 /* Lucifer */ + +#define ETYPE_NULL 0x0000 +#define ETYPE_DES_CBC_CRC 0x0001 /* DES cbc mode with CRC-32 */ +#define ETYPE_LUCIFER_CRC 0x0002 + +#define CKSUMTYPE_CRC32 0x0001 +#define CKSUMTYPE_XXX 0x0002 +#define CKSUMTYPE_XEROX 0x0003 +#define CKSUMTYPE_DESCBC 0x0004 + +/* macros to determine if a type is a local type */ +#define KEYTYPE_IS_LOCAL(keytype) (keytype & 0x8000) +#define ETYPE_IS_LOCAL(etype) (etype & 0x8000) +#define CKSUMTYPE_IS_LOCAL(cksumtype) (cksumtype & 0x8000) + +#endif /* __KRB5_ENCRYPTION__ */ diff --git a/src/include/krb5/hostaddr.h b/src/include/krb5/hostaddr.h new file mode 100644 index 000000000..4ea4cce32 --- /dev/null +++ b/src/include/krb5/hostaddr.h @@ -0,0 +1,38 @@ +/* + * $Source$ + * $Author$ + * $Id$ + * + * Copyright 1989 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * hostaddr definitions for Kerberos version 5. + */ + +#include + +#ifndef __KRB_HOSTADDR__ +#define __KRB_HOSTADDR__ + +/* structure for address */ +typedef struct _krb5_address { + krb5_addrtype addrtype; + int length; + octet contents[1]; /* actually can be more, depending + on length */ +} krb5_address; + +/* per Kerberos v5 protocol spec */ +#define ADDRTYPE_INET 0x0002 +#define ADDRTYPE_CHAOS 0x0005 +#define ADDRTYPE_XNS 0x0006 +#define ADDRTYPE_ISO 0x0007 +#define ADDRTYPE_DDP 0x0010 + +/* macros to determine if a type is a local type */ +#define ADDRTYPE_IS_LOCAL(addrtype) (addrtype & 0x8000) + +#endif /* __KRB_HOSTADDR__ */ + diff --git a/src/include/krb5/krb5.h b/src/include/krb5/krb5.h new file mode 100644 index 000000000..aacf802aa --- /dev/null +++ b/src/include/krb5/krb5.h @@ -0,0 +1,24 @@ +/* + * $Source$ + * $Author$ + * $Id$ + * + * Copyright 1989 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * General definitions for Kerberos version 5. + */ + +#include + +#ifndef __KRB_GENERAL__ +#define __KRB_GENERAL__ + +#include +#include +#include +#include + +#endif /* __KRB_GENERAL__ */ diff --git a/src/include/krb5/mit-des.h b/src/include/krb5/mit-des.h new file mode 100644 index 000000000..9ead12f69 --- /dev/null +++ b/src/include/krb5/mit-des.h @@ -0,0 +1,32 @@ +/* + * $Source$ + * $Author$ + * $Id$ + * + * Copyright 1989 by the Massachusetts Institute of Technology. + * + * For copying and distribution information, please see the file + * . + * + * MIT Data Encryption Standard software implementation declarations. + */ + +#include + +#ifndef __MIT_DES__ +#define __MIT_DES__ + +typedef octet des_cblock[8]; /* crypto-block size */ + +/* Key schedule--used internally by DES routines to gain some speed */ +typedef struct des_ks_struct { des_cblock _; } des_key_schedule[16]; + +#define DES_KEY_SZ (8*sizeof(octet)) + +/* the first byte of the key is already in the keyblock */ +#define DES_KEYBLOCK_SZ (sizeof(krb5_keyblock)+sizeof(des_cblock)-sizeof(octet)) + +#define DES_ENCRYPT 1 +#define DES_DECRYPT 0 + +#endif /* __MIT_DES__ */