From d133eef6eaee86ac64674adcb899d82effd7d983 Mon Sep 17 00:00:00 2001 From: edg Date: Mon, 21 May 1990 18:03:36 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@895 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/des/Imakefile | 9 ++++++--- src/lib/crypto/des/enc_dec.c | 21 +++++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/lib/crypto/des/Imakefile b/src/lib/crypto/des/Imakefile index 51bba2fc1..76bedfba0 100644 --- a/src/lib/crypto/des/Imakefile +++ b/src/lib/crypto/des/Imakefile @@ -41,10 +41,13 @@ $(SRCS): fp.c ip.c key_perm.h odd.h p.c p_table.h s_table.h clean:: $(RM) fp.c ip.c key_perm.h odd.h p.c p_table.h s_table.h -EXT_LIB = $(TOP)/error_tables/krb5_err.o $(TOP)/error_tables/isode_err.o \ -libdes.a -lcom_err +EXT_LIB = $(TOP)/error_tables/krb5_err.o \ + $(TOP)/error_tables/isode_err.o \ + $(TOP)/lib/cryptoconf.o \ + $(TOP)/lib/crc-32/libcrc32.a \ + libdes.a -lcom_err -NormalProgramTarget(verify, $(VERIFYOBJ), EXT_LIB, EXT_LIB, -lcom_err) +NormalProgramTarget(verify, $(VERIFYOBJ), ,$(EXT_LIB),) NormalProgramTarget(make_e, make_e.o, misc.o, misc.o, ) diff --git a/src/lib/crypto/des/enc_dec.c b/src/lib/crypto/des/enc_dec.c index a486f575e..f5872e761 100644 --- a/src/lib/crypto/des/enc_dec.c +++ b/src/lib/crypto/des/enc_dec.c @@ -35,6 +35,7 @@ static char enc_dec_c[] = #include #include +#include #include "des_int.h" @@ -57,15 +58,15 @@ OLDDECLARG(krb5_encrypt_block *, key) OLDDECLARG(krb5_pointer, ivec) { krb5_checksum cksum; - krb5_octet contents[4]; + krb5_octet contents[CRC32_CKSUM_LENGTH]; char *p; krb5_error_code retval, mit_des_encrypt_f(); if ( size < sizeof(mit_des_cblock) ) return KRB5_BAD_MSIZE; - p = (char *)in + size - 4; - bzero(p, 4); + p = (char *)in + size - CRC32_CKSUM_LENGTH; + bzero(p, CRC32_CKSUM_LENGTH); cksum.contents = contents; if (retval = (*krb5_cksumarray[CKSUMTYPE_CRC32]-> @@ -76,7 +77,7 @@ OLDDECLARG(krb5_pointer, ivec) &cksum)) return retval; - bcopy((char *)contents, p, 4); + bcopy((char *)contents, p, CRC32_CKSUM_LENGTH); return (mit_des_encrypt_f(in, out, size, key, ivec)); } @@ -131,8 +132,8 @@ OLDDECLARG(krb5_encrypt_block *, key) OLDDECLARG(krb5_pointer, ivec) { krb5_checksum cksum; - krb5_octet contents_prd[4]; - krb5_octet contents_get[4]; + krb5_octet contents_prd[CRC32_CKSUM_LENGTH]; + krb5_octet contents_get[CRC32_CKSUM_LENGTH]; char *p; krb5_error_code retval, mit_des_decrypt_f(); @@ -143,9 +144,9 @@ OLDDECLARG(krb5_pointer, ivec) return retval; cksum.contents = contents_prd; - p = (char *)out + size - 4; - bcopy(p, (char *)contents_get, 4); - bzero(p, 4); + p = (char *)out + size - CRC32_CKSUM_LENGTH; + bcopy(p, (char *)contents_get, CRC32_CKSUM_LENGTH); + bzero(p, CRC32_CKSUM_LENGTH); if (retval = (*krb5_cksumarray[CKSUMTYPE_CRC32]-> sum_func)(out, @@ -155,7 +156,7 @@ OLDDECLARG(krb5_pointer, ivec) &cksum)) return retval; - if ( bcmp((char *)contents_get, (char *)contents_prd, 4) ) + if ( bcmp((char *)contents_get, (char *)contents_prd, CRC32_CKSUM_LENGTH) ) return KRB5KRB_AP_ERR_BAD_INTEGRITY; return 0; -- 2.26.2