From: Theodore Tso Date: Tue, 4 Oct 1994 19:14:06 +0000 (+0000) Subject: Add structure magic numbers X-Git-Tag: krb5-1.0-beta4.3~21 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=be69bb07f4b3a51e6bbe8a013f28d58e4d4fe4bc;p=krb5.git Add structure magic numbers git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4438 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog index 04832224d..1567c36d8 100644 --- a/src/include/krb5/ChangeLog +++ b/src/include/krb5/ChangeLog @@ -1,3 +1,7 @@ +Tue Oct 4 14:51:32 1994 Theodore Y. Ts'o (tytso@dcl) + +* encryption.h: Add magic number to encryption structures. + Mon Oct 3 18:45:55 1994 Theodore Y. Ts'o (tytso@dcl) * kdb.h: Add magic number to _krb5_db_entry. (This among other diff --git a/src/include/krb5/encryption.h b/src/include/krb5/encryption.h index 08d602471..5305870db 100644 --- a/src/include/krb5/encryption.h +++ b/src/include/krb5/encryption.h @@ -29,18 +29,21 @@ #define KRB5_ENCRYPTION__ typedef struct _krb5_keyblock { + krb5_magic magic; krb5_keytype keytype; int length; krb5_octet *contents; } krb5_keyblock; typedef struct _krb5_checksum { + krb5_magic magic; krb5_cksumtype checksum_type; /* checksum type */ int length; krb5_octet *contents; } krb5_checksum; typedef struct _krb5_encrypt_block { + krb5_magic magic; struct _krb5_cryptosystem_entry *crypto_entry; krb5_keyblock *key; krb5_pointer priv; /* for private use, e.g. DES @@ -48,6 +51,7 @@ typedef struct _krb5_encrypt_block { } krb5_encrypt_block; typedef struct _krb5_enc_data { + krb5_magic magic; krb5_enctype etype; krb5_kvno kvno; krb5_data ciphertext; @@ -57,6 +61,7 @@ typedef struct _krb5_enc_data { /* could be used in a table to find an etype and initialize a block */ typedef struct _krb5_cryptosystem_entry { + krb5_magic magic; krb5_error_code (*encrypt_func) NPROTOTYPE((krb5_const_pointer /* in */, krb5_pointer /* out */, const size_t, @@ -93,12 +98,14 @@ typedef struct _krb5_cryptosystem_entry { #include typedef struct _krb5_cs_table_entry { + krb5_magic magic; krb5_cryptosystem_entry *system; krb5_pointer random_sequence; /* from init_random_key() */ } krb5_cs_table_entry; /* could be used in a table to find a sumtype */ typedef struct _krb5_checksum_entry { + krb5_magic magic; krb5_error_code (*sum_func) NPROTOTYPE ((krb5_pointer /* in */, size_t /* in_length */, krb5_pointer /* key/seed */, diff --git a/src/lib/crypto/des/cs_entry.c b/src/lib/crypto/des/cs_entry.c index e17f0f8bd..8baa8778f 100644 --- a/src/lib/crypto/des/cs_entry.c +++ b/src/lib/crypto/des/cs_entry.c @@ -32,6 +32,7 @@ #include "des_int.h" static krb5_cryptosystem_entry mit_raw_des_cryptosystem_entry = { + 0, mit_raw_des_encrypt_func, mit_raw_des_decrypt_func, mit_des_process_key, @@ -48,6 +49,7 @@ static krb5_cryptosystem_entry mit_raw_des_cryptosystem_entry = { }; static krb5_cryptosystem_entry mit_des_cryptosystem_entry = { + 0, mit_des_encrypt_func, mit_des_decrypt_func, mit_des_process_key, @@ -64,11 +66,13 @@ static krb5_cryptosystem_entry mit_des_cryptosystem_entry = { }; krb5_cs_table_entry krb5_raw_des_cst_entry = { + 0, &mit_raw_des_cryptosystem_entry, 0 }; krb5_cs_table_entry krb5_des_cst_entry = { + 0, &mit_des_cryptosystem_entry, 0 }; @@ -81,6 +85,7 @@ extern krb5_error_code mit_des_cbc_checksum PROTOTYPE ((krb5_pointer , krb5_checksum_entry krb5_des_cbc_cksumtable_entry = { + 0, mit_des_cbc_checksum, sizeof(mit_des_cblock), 1, /* is collision proof */ diff --git a/src/lib/crypto/md4/md4glue.c b/src/lib/crypto/md4/md4glue.c index 457dbea65..d9449f9de 100644 --- a/src/lib/crypto/md4/md4glue.c +++ b/src/lib/crypto/md4/md4glue.c @@ -54,6 +54,7 @@ krb5_checksum *outcksum; } krb5_checksum_entry rsa_md4_cksumtable_entry = { + 0, md4_sum_func, RSA_MD4_CKSUM_LENGTH, 1, /* is collision proof */ diff --git a/src/lib/crypto/md5/md5glue.c b/src/lib/crypto/md5/md5glue.c index 97512b2e1..439fcb45d 100644 --- a/src/lib/crypto/md5/md5glue.c +++ b/src/lib/crypto/md5/md5glue.c @@ -27,6 +27,7 @@ krb5_checksum *outcksum; } krb5_checksum_entry rsa_md5_cksumtable_entry = { + 0, md5_sum_func, RSA_MD5_CKSUM_LENGTH, 1, /* is collision proof */