diff options
| author | Greg Hudson <ghudson@mit.edu> | 2011-03-02 05:29:29 +0000 |
|---|---|---|
| committer | Greg Hudson <ghudson@mit.edu> | 2011-03-02 05:29:29 +0000 |
| commit | ce6d249fdf1dd7dda5b202836ed387500324ae2a (patch) | |
| tree | b0550b898743ddfdff76ac6647fca7a12d6db284 /src/lib/crypto/openssl/md5 | |
| parent | e2d6d9ce23b878334d70a0f9c697064873619b75 (diff) | |
| download | krb5-ce6d249fdf1dd7dda5b202836ed387500324ae2a.tar.gz krb5-ce6d249fdf1dd7dda5b202836ed387500324ae2a.tar.xz krb5-ce6d249fdf1dd7dda5b202836ed387500324ae2a.zip | |
Consolidate almost all lib/crypto/krb headers into a single
crypto_int.h. In that header, define and document responsibilities
for crypto modules, some of which are satisfied through a
module-specific crypto_mod.h. In the OpenSSL and NSS modules, remove
many of the headers and sources providing functionality which isn't
needed by lib/crypto/krb any more (direct interfaces to MD4, MD5, and
SHA-1 hashing, as well as DES weak key testing). Change most
Makefile.ins to only include headers from lib/crypto/krb and
lib/crypto/$(CRYPTO_IMPL), instead of from many different directories.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24677 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/openssl/md5')
| -rw-r--r-- | src/lib/crypto/openssl/md5/Makefile.in | 9 | ||||
| -rw-r--r-- | src/lib/crypto/openssl/md5/deps | 15 | ||||
| -rw-r--r-- | src/lib/crypto/openssl/md5/md5.c | 60 | ||||
| -rw-r--r-- | src/lib/crypto/openssl/md5/rsa-md5.h | 92 |
4 files changed, 4 insertions, 172 deletions
diff --git a/src/lib/crypto/openssl/md5/Makefile.in b/src/lib/crypto/openssl/md5/Makefile.in index 9c3d340912..4128e98c5b 100644 --- a/src/lib/crypto/openssl/md5/Makefile.in +++ b/src/lib/crypto/openssl/md5/Makefile.in @@ -2,14 +2,11 @@ mydir=lib$(S)crypto$(S)openssl$(S)md5 BUILDTOP=$(REL)..$(S)..$(S)..$(S).. DEFS= -PROG_LIBPATH=-L$(TOPLIBD) -PROG_RPATH=$(KRB5_LIBDIR) +STLIBOBJS= -STLIBOBJS= md5.o +OBJS= -OBJS= $(OUTPRE)md5.$(OBJEXT) - -SRCS= $(srcdir)/md5.c +SRCS= all-unix:: all-libobjs diff --git a/src/lib/crypto/openssl/md5/deps b/src/lib/crypto/openssl/md5/deps index f32dbe9c71..2feac3c9d3 100644 --- a/src/lib/crypto/openssl/md5/deps +++ b/src/lib/crypto/openssl/md5/deps @@ -1,14 +1 @@ -# -# Generated makefile dependencies follow. -# -md5.so md5.po $(OUTPRE)md5.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \ - $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \ - $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(top_srcdir)/include/k5-buf.h \ - $(top_srcdir)/include/k5-err.h $(top_srcdir)/include/k5-gmt_mktime.h \ - $(top_srcdir)/include/k5-int-pkinit.h $(top_srcdir)/include/k5-int.h \ - $(top_srcdir)/include/k5-platform.h $(top_srcdir)/include/k5-plugin.h \ - $(top_srcdir)/include/k5-thread.h $(top_srcdir)/include/k5-trace.h \ - $(top_srcdir)/include/krb5.h $(top_srcdir)/include/krb5/authdata_plugin.h \ - $(top_srcdir)/include/krb5/plugin.h $(top_srcdir)/include/krb5/preauth_plugin.h \ - $(top_srcdir)/include/port-sockets.h $(top_srcdir)/include/socket-utils.h \ - md5.c rsa-md5.h +# No dependencies here. diff --git a/src/lib/crypto/openssl/md5/md5.c b/src/lib/crypto/openssl/md5/md5.c deleted file mode 100644 index 41a8498f36..0000000000 --- a/src/lib/crypto/openssl/md5/md5.c +++ /dev/null @@ -1,60 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* lib/crypto/openssl/md5/md5.c - * - * Copyright (C) 2009 by the Massachusetts Institute of Technology. - * 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 M.I.T. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. Furthermore if you modify this software you must label - * your software as modified software and not distribute it in such a - * fashion that it might be confused with the original M.I.T. software. - * M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - */ - -#include "k5-int.h" -#include "rsa-md5.h" -#include <openssl/evp.h> -#include <openssl/md5.h> - -/* The routine krb5int_MD5Init initializes the message-digest context - mdContext. All fields are set to zero. -*/ -void -krb5int_MD5Init (krb5_MD5_CTX *mdContext) -{ - EVP_MD_CTX_init(&mdContext->ossl_md5_ctx); - EVP_DigestInit_ex(&mdContext->ossl_md5_ctx, EVP_md5(), NULL); -} - -/* The routine krb5int_MD5Update updates the message-digest context to - account for the presence of each of the characters inBuf[0..inLen-1] - in the message whose digest is being computed. -*/ -void -krb5int_MD5Update (krb5_MD5_CTX *mdContext, const unsigned char *inBuf, unsigned int inLen) -{ - EVP_DigestUpdate(&mdContext->ossl_md5_ctx, inBuf, inLen); -} - -/* The routine krb5int_MD5Final terminates the message-digest computation and - ends with the desired message digest in mdContext->digest[0...15]. -*/ -void -krb5int_MD5Final (krb5_MD5_CTX *mdContext) -{ - EVP_DigestFinal_ex(&mdContext->ossl_md5_ctx, mdContext->digest, NULL); - EVP_MD_CTX_cleanup(&mdContext->ossl_md5_ctx); -} diff --git a/src/lib/crypto/openssl/md5/rsa-md5.h b/src/lib/crypto/openssl/md5/rsa-md5.h deleted file mode 100644 index a8380f4498..0000000000 --- a/src/lib/crypto/openssl/md5/rsa-md5.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ -/* lib/crypto/openssl/md5/rsa-md5.h - * - * Copyright (C) 2009 by the Massachusetts Institute of Technology. - * 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 M.I.T. not be used in advertising or publicity pertaining - * to distribution of the software without specific, written prior - * permission. Furthermore if you modify this software you must label - * your software as modified software and not distribute it in such a - * fashion that it might be confused with the original M.I.T. software. - * M.I.T. makes no representations about the suitability of - * this software for any purpose. It is provided "as is" without express - * or implied warranty. - */ - -/* -*********************************************************************** -** md5.h -- header file for implementation of MD5 ** -** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** -** Created: 2/17/90 RLR ** -** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** -** Revised (for MD5): RLR 4/27/91 ** -** -- G modified to have y&~z instead of y&z ** -** -- FF, GG, HH modified to add in last register done ** -** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** -** -- distinct additive constant for each step ** -** -- round 4 added, working mod 7 ** -*********************************************************************** -*/ - -/* -*********************************************************************** -** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** -** ** -** License to copy and use this software is granted provided that ** -** it is identified as the "RSA Data Security, Inc. MD5 Message- ** -** Digest Algorithm" in all material mentioning or referencing this ** -** software or this function. ** -** ** -** License is also granted to make and use derivative works ** -** provided that such works are identified as "derived from the RSA ** -** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** -** material mentioning or referencing the derived work. ** -** ** -** RSA Data Security, Inc. makes no representations concerning ** -** either the merchantability of this software or the suitability ** -** of this software for any particular purpose. It is provided "as ** -** is" without express or implied warranty of any kind. ** -** ** -** These notices must be retained in any copies of any part of this ** -** documentation and/or software. ** -*********************************************************************** -*/ - - -#ifndef KRB5_RSA_MD5__ -#define KRB5_RSA_MD5__ - -#include <openssl/evp.h> -#include <openssl/md5.h> - -/* Data structure for MD5 (Message-Digest) computation */ -typedef struct { - EVP_MD_CTX ossl_md5_ctx; - krb5_int32 * digest_len; - krb5_ui_4 i[2]; /* number of _bits_ handled mod 2^64 */ - krb5_ui_4 buf[4]; /* scratch buffer */ - unsigned char in[64]; /* input buffer */ - unsigned char digest[16]; /* actual digest after MD5Final call */ -} krb5_MD5_CTX; - -extern void krb5int_MD5Init(krb5_MD5_CTX *); -extern void krb5int_MD5Update(krb5_MD5_CTX *,const unsigned char *,unsigned int); -extern void krb5int_MD5Final(krb5_MD5_CTX *); - -#define RSA_MD5_CKSUM_LENGTH 16 -#define OLD_RSA_MD5_DES_CKSUM_LENGTH 16 -#define NEW_RSA_MD5_DES_CKSUM_LENGTH 24 -#define RSA_MD5_DES_CONFOUND_LENGTH 8 - -#endif /* KRB5_RSA_MD5__ */ |
