summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/openssl
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2011-02-24 18:18:11 +0000
committerGreg Hudson <ghudson@mit.edu>2011-02-24 18:18:11 +0000
commit0489db92b69f14ab4249992c1302bf8676cecc5c (patch)
treed73675275931851d53f0da6020896edcc3fa8115 /src/lib/crypto/openssl
parent9da66a5ca4e9b39239a91df293439918e6c28817 (diff)
downloadkrb5-0489db92b69f14ab4249992c1302bf8676cecc5c.tar.gz
krb5-0489db92b69f14ab4249992c1302bf8676cecc5c.tar.xz
krb5-0489db92b69f14ab4249992c1302bf8676cecc5c.zip
Unbreak the OpenSSL and NSS crypto builds in the wake of r24652
(Fortuna as default PRNG), and remove some unnecessary related files. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24656 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/openssl')
-rw-r--r--src/lib/crypto/openssl/Makefile.in9
-rw-r--r--src/lib/crypto/openssl/aes/Makefile.in6
-rw-r--r--src/lib/crypto/openssl/aes/aes.h (renamed from src/lib/crypto/openssl/sha2/sha256.c)20
-rw-r--r--src/lib/crypto/openssl/sha2/Makefile.in16
-rw-r--r--src/lib/crypto/openssl/sha2/sha2.h4
-rw-r--r--src/lib/crypto/openssl/stubs.c69
6 files changed, 101 insertions, 23 deletions
diff --git a/src/lib/crypto/openssl/Makefile.in b/src/lib/crypto/openssl/Makefile.in
index ff43d56d8..f3992c21a 100644
--- a/src/lib/crypto/openssl/Makefile.in
+++ b/src/lib/crypto/openssl/Makefile.in
@@ -18,17 +18,20 @@ DEFS=
STLIBOBJS=\
hmac.o \
init.o \
- pbkdf2.o
+ pbkdf2.o \
+ stubs.o
OBJS=\
$(OUTPRE)hmac.$(OBJEXT) \
$(OUTPRE)init.$(OBJEXT) \
- $(OUTPRE)pbkdf2.$(OBJEXT)
+ $(OUTPRE)pbkdf2.$(OBJEXT) \
+ $(OUTPRE)stubs.$(OBJEXT)
SRCS=\
$(srcdir)/hmac.c \
$(srcdir)/init.c \
- $(srcdir)/pbkdf2.c
+ $(srcdir)/pbkdf2.c \
+ $(srcdir)/stubs.c
STOBJLISTS= des/OBJS.ST md4/OBJS.ST \
md5/OBJS.ST sha1/OBJS.ST sha2/OBJS.ST \
diff --git a/src/lib/crypto/openssl/aes/Makefile.in b/src/lib/crypto/openssl/aes/Makefile.in
index b8a7de924..6df0e0d44 100644
--- a/src/lib/crypto/openssl/aes/Makefile.in
+++ b/src/lib/crypto/openssl/aes/Makefile.in
@@ -4,12 +4,9 @@
mydir=lib$(S)crypto$(S)openssl$(S)aes
BUILDTOP=$(REL)..$(S)..$(S)..$(S)..
-LOCALINCLUDES = -I$(srcdir)/.. -I$(srcdir)/../../krb/dk -I$(srcdir)/../../../../include
+LOCALINCLUDES=
DEFS=
-PROG_LIBPATH=-L$(TOPLIBD)
-PROG_RPATH=$(KRB5_LIBDIR)
-
STLIBOBJS=
OBJS=
@@ -25,4 +22,3 @@ depend:: $(SRCS)
clean-unix:: clean-libobjs
@libobj_frag@
-
diff --git a/src/lib/crypto/openssl/sha2/sha256.c b/src/lib/crypto/openssl/aes/aes.h
index c57805203..4aa9eb848 100644
--- a/src/lib/crypto/openssl/sha2/sha256.c
+++ b/src/lib/crypto/openssl/aes/aes.h
@@ -1,8 +1,8 @@
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-/* lib/crypto/openssl/sha2/sha256.c
- *
- * Copyright (C) 2010 by the Massachusetts Institute of Technology.
- * All rights reserved.
+/* lib/crypto/openssl/aes/aes.h - AES translation macros */
+/*
+ * Copyright 2011 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.
@@ -24,5 +24,15 @@
* or implied warranty.
*/
-#include "sha2.h"
+#ifndef _AES_H
+#define _AES_H
+
+/* This header maps some of the names of the built-in AES types and functions
+ * (those used by the Fortuna PRNG) to the OpenSSL equivalents. */
+#include <openssl/aes.h>
+
+#define aes_ctx AES_KEY
+#define krb5int_aes_enc_key(k, len, ctx) AES_set_encrypt_key(k, 8*(len), ctx)
+#define krb5int_aes_enc_blk(in, out, ctx) AES_encrypt(in, out, ctx)
+#endif /* _AES_H */
diff --git a/src/lib/crypto/openssl/sha2/Makefile.in b/src/lib/crypto/openssl/sha2/Makefile.in
index edb93bd27..cddb434e4 100644
--- a/src/lib/crypto/openssl/sha2/Makefile.in
+++ b/src/lib/crypto/openssl/sha2/Makefile.in
@@ -1,17 +1,22 @@
-mydir=lib$(S)crypto$(S)openssl$(S)sha2
+# Nothing here! But we can't remove this directory as the build
+# system currently assumes that all modules have the same directory
+# structure.
+
+mydir=lib$(S)crypto$(S)openssl$(S)aes
BUILDTOP=$(REL)..$(S)..$(S)..$(S)..
+LOCALINCLUDES=
DEFS=
PROG_LIBPATH=-L$(TOPLIBD)
PROG_RPATH=$(KRB5_LIBDIR)
-STLIBOBJS= sha256.o
+STLIBOBJS=
-OBJS= $(OUTPRE)sha256.$(OBJEXT)
+OBJS=
-SRCS= $(srcdir)/sha256.c
+SRCS=
-all-unix:: all-libobjs
+all-unix:: all-libobjs
includes:: depend
@@ -20,4 +25,3 @@ depend:: $(SRCS)
clean-unix:: clean-libobjs
@libobj_frag@
-
diff --git a/src/lib/crypto/openssl/sha2/sha2.h b/src/lib/crypto/openssl/sha2/sha2.h
index a80fbcb7a..0f61d5dc4 100644
--- a/src/lib/crypto/openssl/sha2/sha2.h
+++ b/src/lib/crypto/openssl/sha2/sha2.h
@@ -27,14 +27,10 @@
#ifndef _SHA2_DEFINED
-#include "k5-int.h"
-#include <openssl/evp.h>
#include <openssl/sha.h>
#define _SHA2_DEFINED
-#define SHA2_DIGESTSIZE 32
-
#define sha2Init SHA256_Init
#define sha2Update SHA256_Update
#define sha2Final SHA256_Final
diff --git a/src/lib/crypto/openssl/stubs.c b/src/lib/crypto/openssl/stubs.c
new file mode 100644
index 000000000..220df388a
--- /dev/null
+++ b/src/lib/crypto/openssl/stubs.c
@@ -0,0 +1,69 @@
+/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/* lib/crypto/openssl/stubs.c - OpenSSL stub functions */
+/*
+ * Copyright (C) 2011 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.
+ */
+
+/*
+ * This file defines symbols which must be exported by libk5crypto because they
+ * are in the export list (for the sake of test programs), but which are not
+ * used when OpenSSL is the back end.
+ */
+
+#include "k5-int.h"
+
+/*
+ * These functions are used by the Fortuna PRNG and test program. They are
+ * defined to OpenSSL equivalents when the OpenSSL back end headers are
+ * used.
+ */
+void krb5int_aes_enc_blk(void);
+void krb5int_aes_enc_key(void);
+void sha2Final(void);
+void sha2Init(void);
+void sha2Update(void);
+
+void krb5int_aes_enc_blk(void)
+{
+ abort();
+}
+
+void krb5int_aes_enc_key(void)
+{
+ abort();
+}
+
+void sha2Final(void)
+{
+ abort();
+}
+
+void sha2Init(void)
+{
+ abort();
+}
+
+void sha2Update(void)
+{
+ abort();
+}