From f2b3d32106fe999c002cb3ccf8db7c6e0ced7263 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Thu, 5 Nov 1998 21:51:29 +0000 Subject: Fixed filename uniqueness problems by renaming all of the *.c files to be hash_*.c files. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11017 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/hash_provider/Makefile.in | 8 ++-- src/lib/crypto/hash_provider/crc32.c | 71 ------------------------------ src/lib/crypto/hash_provider/hash_crc32.c | 71 ++++++++++++++++++++++++++++++ src/lib/crypto/hash_provider/hash_md4.c | 67 ++++++++++++++++++++++++++++ src/lib/crypto/hash_provider/hash_md5.c | 67 ++++++++++++++++++++++++++++ src/lib/crypto/hash_provider/hash_sha1.c | 72 +++++++++++++++++++++++++++++++ src/lib/crypto/hash_provider/md4.c | 67 ---------------------------- src/lib/crypto/hash_provider/md5.c | 67 ---------------------------- src/lib/crypto/hash_provider/sha1.c | 72 ------------------------------- 9 files changed, 282 insertions(+), 280 deletions(-) delete mode 100644 src/lib/crypto/hash_provider/crc32.c create mode 100644 src/lib/crypto/hash_provider/hash_crc32.c create mode 100644 src/lib/crypto/hash_provider/hash_md4.c create mode 100644 src/lib/crypto/hash_provider/hash_md5.c create mode 100644 src/lib/crypto/hash_provider/hash_sha1.c delete mode 100644 src/lib/crypto/hash_provider/md4.c delete mode 100644 src/lib/crypto/hash_provider/md5.c delete mode 100644 src/lib/crypto/hash_provider/sha1.c (limited to 'src/lib') diff --git a/src/lib/crypto/hash_provider/Makefile.in b/src/lib/crypto/hash_provider/Makefile.in index 97f1ad423..7f9825439 100644 --- a/src/lib/crypto/hash_provider/Makefile.in +++ b/src/lib/crypto/hash_provider/Makefile.in @@ -13,11 +13,13 @@ PROG_RPATH=$(KRB5_LIBDIR) RUN_SETUP = @KRB5_RUN_ENV@ KRB5_CONFIG=$(SRCTOP)/config-files/krb5.conf -STLIBOBJS= crc32.o md4.o md5.o sha1.o +STLIBOBJS= hash_crc32.o hash_md4.o hash_md5.o hash_sha1.o -OBJS= crc32.$(OBJEXT) md4.$(OBJEXT) md5.$(OBJEXT) sha1.$(OBJEXT) +OBJS= hash_crc32.$(OBJEXT) hash_md4.$(OBJEXT) \ + hash_md5.$(OBJEXT) hash_sha1.$(OBJEXT) -SRCS= $(srcdir)/crc32.c $(srcdir)/md4.c $(srcdir)/md5.c $(srcdir)/sha1.c +SRCS= $(srcdir)/hash_crc32.c $(srcdir)/hash_md4.c \ + $(srcdir)/hash_md5.c $(srcdir)/hash_sha1.c ##DOS##LIBOBJS = $(OBJS) diff --git a/src/lib/crypto/hash_provider/crc32.c b/src/lib/crypto/hash_provider/crc32.c deleted file mode 100644 index 7c30b3d10..000000000 --- a/src/lib/crypto/hash_provider/crc32.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 1998 by the FundsXpress, INC. - * - * All rights reserved. - * - * Export of this software from the United States of America may require - * a specific license from the United States Government. It is the - * responsibility of any person or organization contemplating export to - * obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of FundsXpress. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. FundsXpress makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include "k5-int.h" -#include "crc-32.h" -#include "hash_provider.h" - -static void -k5_crc32_hash_size(size_t *output) -{ - *output = CRC32_CKSUM_LENGTH; -} - -static void -k5_crc32_block_size(size_t *output) -{ - *output = 1; -} - -static krb5_error_code -k5_crc32_hash(unsigned int icount, krb5_const krb5_data *input, - krb5_data *output) -{ - unsigned long c, cn; - int i; - - if (output->length != CRC32_CKSUM_LENGTH) - return(KRB5_CRYPTO_INTERNAL); - - c = 0; - for (i=0; idata[0] = c&0xff; - output->data[1] = (c>>8)&0xff; - output->data[2] = (c>>16)&0xff; - output->data[3] = (c>>24)&0xff; - - return(0); -} - -struct krb5_hash_provider krb5_hash_crc32 = { - k5_crc32_hash_size, - k5_crc32_block_size, - k5_crc32_hash -}; diff --git a/src/lib/crypto/hash_provider/hash_crc32.c b/src/lib/crypto/hash_provider/hash_crc32.c new file mode 100644 index 000000000..7c30b3d10 --- /dev/null +++ b/src/lib/crypto/hash_provider/hash_crc32.c @@ -0,0 +1,71 @@ +/* + * Copyright (C) 1998 by the FundsXpress, INC. + * + * All rights reserved. + * + * Export of this software from the United States of America may require + * a specific license from the United States Government. It is the + * responsibility of any person or organization contemplating export to + * obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of FundsXpress. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. FundsXpress makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include "k5-int.h" +#include "crc-32.h" +#include "hash_provider.h" + +static void +k5_crc32_hash_size(size_t *output) +{ + *output = CRC32_CKSUM_LENGTH; +} + +static void +k5_crc32_block_size(size_t *output) +{ + *output = 1; +} + +static krb5_error_code +k5_crc32_hash(unsigned int icount, krb5_const krb5_data *input, + krb5_data *output) +{ + unsigned long c, cn; + int i; + + if (output->length != CRC32_CKSUM_LENGTH) + return(KRB5_CRYPTO_INTERNAL); + + c = 0; + for (i=0; idata[0] = c&0xff; + output->data[1] = (c>>8)&0xff; + output->data[2] = (c>>16)&0xff; + output->data[3] = (c>>24)&0xff; + + return(0); +} + +struct krb5_hash_provider krb5_hash_crc32 = { + k5_crc32_hash_size, + k5_crc32_block_size, + k5_crc32_hash +}; diff --git a/src/lib/crypto/hash_provider/hash_md4.c b/src/lib/crypto/hash_provider/hash_md4.c new file mode 100644 index 000000000..bfce845a4 --- /dev/null +++ b/src/lib/crypto/hash_provider/hash_md4.c @@ -0,0 +1,67 @@ +/* + * Copyright (C) 1998 by the FundsXpress, INC. + * + * All rights reserved. + * + * Export of this software from the United States of America may require + * a specific license from the United States Government. It is the + * responsibility of any person or organization contemplating export to + * obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of FundsXpress. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. FundsXpress makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include "k5-int.h" +#include "rsa-md4.h" +#include "hash_provider.h" + +static void +k5_md4_hash_size(size_t *output) +{ + *output = RSA_MD4_CKSUM_LENGTH; +} + +static void +k5_md4_block_size(size_t *output) +{ + *output = 64; +} + +static krb5_error_code +k5_md4_hash(unsigned int icount, krb5_const krb5_data *input, + krb5_data *output) +{ + krb5_MD4_CTX ctx; + int i; + + if (output->length != RSA_MD4_CKSUM_LENGTH) + return(KRB5_CRYPTO_INTERNAL); + + krb5_MD4Init(&ctx); + for (i=0; idata, ctx.digest, RSA_MD4_CKSUM_LENGTH); + + return(0); +} + +struct krb5_hash_provider krb5_hash_md4 = { + k5_md4_hash_size, + k5_md4_block_size, + k5_md4_hash +}; diff --git a/src/lib/crypto/hash_provider/hash_md5.c b/src/lib/crypto/hash_provider/hash_md5.c new file mode 100644 index 000000000..98f934001 --- /dev/null +++ b/src/lib/crypto/hash_provider/hash_md5.c @@ -0,0 +1,67 @@ +/* + * Copyright (C) 1998 by the FundsXpress, INC. + * + * All rights reserved. + * + * Export of this software from the United States of America may require + * a specific license from the United States Government. It is the + * responsibility of any person or organization contemplating export to + * obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of FundsXpress. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. FundsXpress makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include "k5-int.h" +#include "rsa-md5.h" +#include "hash_provider.h" + +static void +k5_md5_hash_size(size_t *output) +{ + *output = RSA_MD5_CKSUM_LENGTH; +} + +static void +k5_md5_block_size(size_t *output) +{ + *output = 64; +} + +static krb5_error_code +k5_md5_hash(unsigned int icount, krb5_const krb5_data *input, + krb5_data *output) +{ + krb5_MD5_CTX ctx; + int i; + + if (output->length != RSA_MD5_CKSUM_LENGTH) + return(KRB5_CRYPTO_INTERNAL); + + krb5_MD5Init(&ctx); + for (i=0; idata, ctx.digest, RSA_MD5_CKSUM_LENGTH); + + return(0); +} + +struct krb5_hash_provider krb5_hash_md5 = { + k5_md5_hash_size, + k5_md5_block_size, + k5_md5_hash +}; diff --git a/src/lib/crypto/hash_provider/hash_sha1.c b/src/lib/crypto/hash_provider/hash_sha1.c new file mode 100644 index 000000000..a7b886d5a --- /dev/null +++ b/src/lib/crypto/hash_provider/hash_sha1.c @@ -0,0 +1,72 @@ +/* + * Copyright (C) 1998 by the FundsXpress, INC. + * + * All rights reserved. + * + * Export of this software from the United States of America may require + * a specific license from the United States Government. It is the + * responsibility of any person or organization contemplating export to + * obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of FundsXpress. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. FundsXpress makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include "k5-int.h" +#include "shs.h" +#include "hash_provider.h" + +static void +k5_sha1_hash_size(size_t *output) +{ + *output = SHS_DIGESTSIZE; +} + +static void +k5_sha1_block_size(size_t *output) +{ + *output = SHS_DATASIZE; +} + +static krb5_error_code +k5_sha1_hash(unsigned int icount, krb5_const krb5_data *input, + krb5_data *output) +{ + SHS_INFO ctx; + int i; + + if (output->length != SHS_DIGESTSIZE) + return(KRB5_CRYPTO_INTERNAL); + + shsInit(&ctx); + for (i=0; idata[i*4] = (ctx.digest[i]>>24)&0xff; + output->data[i*4+1] = (ctx.digest[i]>>16)&0xff; + output->data[i*4+2] = (ctx.digest[i]>>8)&0xff; + output->data[i*4+3] = ctx.digest[i]&0xff; + } + + return(0); +} + +struct krb5_hash_provider krb5_hash_sha1 = { + k5_sha1_hash_size, + k5_sha1_block_size, + k5_sha1_hash +}; diff --git a/src/lib/crypto/hash_provider/md4.c b/src/lib/crypto/hash_provider/md4.c deleted file mode 100644 index bfce845a4..000000000 --- a/src/lib/crypto/hash_provider/md4.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 1998 by the FundsXpress, INC. - * - * All rights reserved. - * - * Export of this software from the United States of America may require - * a specific license from the United States Government. It is the - * responsibility of any person or organization contemplating export to - * obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of FundsXpress. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. FundsXpress makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include "k5-int.h" -#include "rsa-md4.h" -#include "hash_provider.h" - -static void -k5_md4_hash_size(size_t *output) -{ - *output = RSA_MD4_CKSUM_LENGTH; -} - -static void -k5_md4_block_size(size_t *output) -{ - *output = 64; -} - -static krb5_error_code -k5_md4_hash(unsigned int icount, krb5_const krb5_data *input, - krb5_data *output) -{ - krb5_MD4_CTX ctx; - int i; - - if (output->length != RSA_MD4_CKSUM_LENGTH) - return(KRB5_CRYPTO_INTERNAL); - - krb5_MD4Init(&ctx); - for (i=0; idata, ctx.digest, RSA_MD4_CKSUM_LENGTH); - - return(0); -} - -struct krb5_hash_provider krb5_hash_md4 = { - k5_md4_hash_size, - k5_md4_block_size, - k5_md4_hash -}; diff --git a/src/lib/crypto/hash_provider/md5.c b/src/lib/crypto/hash_provider/md5.c deleted file mode 100644 index 98f934001..000000000 --- a/src/lib/crypto/hash_provider/md5.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 1998 by the FundsXpress, INC. - * - * All rights reserved. - * - * Export of this software from the United States of America may require - * a specific license from the United States Government. It is the - * responsibility of any person or organization contemplating export to - * obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of FundsXpress. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. FundsXpress makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include "k5-int.h" -#include "rsa-md5.h" -#include "hash_provider.h" - -static void -k5_md5_hash_size(size_t *output) -{ - *output = RSA_MD5_CKSUM_LENGTH; -} - -static void -k5_md5_block_size(size_t *output) -{ - *output = 64; -} - -static krb5_error_code -k5_md5_hash(unsigned int icount, krb5_const krb5_data *input, - krb5_data *output) -{ - krb5_MD5_CTX ctx; - int i; - - if (output->length != RSA_MD5_CKSUM_LENGTH) - return(KRB5_CRYPTO_INTERNAL); - - krb5_MD5Init(&ctx); - for (i=0; idata, ctx.digest, RSA_MD5_CKSUM_LENGTH); - - return(0); -} - -struct krb5_hash_provider krb5_hash_md5 = { - k5_md5_hash_size, - k5_md5_block_size, - k5_md5_hash -}; diff --git a/src/lib/crypto/hash_provider/sha1.c b/src/lib/crypto/hash_provider/sha1.c deleted file mode 100644 index a7b886d5a..000000000 --- a/src/lib/crypto/hash_provider/sha1.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 1998 by the FundsXpress, INC. - * - * All rights reserved. - * - * Export of this software from the United States of America may require - * a specific license from the United States Government. It is the - * responsibility of any person or organization contemplating export to - * obtain such a license before exporting. - * - * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - * distribute this software and its documentation for any purpose and - * without fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright notice and - * this permission notice appear in supporting documentation, and that - * the name of FundsXpress. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. FundsXpress makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#include "k5-int.h" -#include "shs.h" -#include "hash_provider.h" - -static void -k5_sha1_hash_size(size_t *output) -{ - *output = SHS_DIGESTSIZE; -} - -static void -k5_sha1_block_size(size_t *output) -{ - *output = SHS_DATASIZE; -} - -static krb5_error_code -k5_sha1_hash(unsigned int icount, krb5_const krb5_data *input, - krb5_data *output) -{ - SHS_INFO ctx; - int i; - - if (output->length != SHS_DIGESTSIZE) - return(KRB5_CRYPTO_INTERNAL); - - shsInit(&ctx); - for (i=0; idata[i*4] = (ctx.digest[i]>>24)&0xff; - output->data[i*4+1] = (ctx.digest[i]>>16)&0xff; - output->data[i*4+2] = (ctx.digest[i]>>8)&0xff; - output->data[i*4+3] = ctx.digest[i]&0xff; - } - - return(0); -} - -struct krb5_hash_provider krb5_hash_sha1 = { - k5_sha1_hash_size, - k5_sha1_block_size, - k5_sha1_hash -}; -- cgit