re-write the handling of crypto libraries. try to use the one of

openssl's libcrypto or krb4's libdes that has all the required
functionality (md4, md5, sha1, des, rc4).  if there is no such
library, the included lib/des is built.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10519 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2001-08-22 20:30:33 +00:00
parent 4df3da117d
commit aad564d1c2
19 changed files with 143 additions and 89 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska H<>gskolan
* Copyright (c) 1995 - 2001 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -131,7 +131,7 @@ struct hostent *gethostbyname(const char *);
#include "security.h"
/* des_read_pw_string */
#ifdef HAVE_OPENSSL_DES_H
#ifdef HAVE_OPENSSL
#include <openssl/des.h>
#else
#include <des.h>

View File

@@ -421,7 +421,7 @@ create_and_write_cookie (char *xauthfile,
auth.name_length = strlen(auth.name);
auth.data_length = cookie_sz;
auth.data = (char*)cookie;
#ifdef HAVE_OPENSSL_DES_H
#ifdef HAVE_OPENSSL
krb5_generate_random_block (cookie, cookie_sz);
#else
des_rand_data (cookie, cookie_sz);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska H<>gskolan
* Copyright (c) 1995 - 2001 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -52,7 +52,7 @@
#endif
#include <roken.h>
#include <err.h>
#ifdef HAVE_OPENSSL_DES_H
#ifdef HAVE_OPENSSL
#include <openssl/des.h>
#else
#include <des.h>

View File

@@ -50,7 +50,7 @@ RCSID("$Id$");
#include "encrypt.h"
#include "misc-proto.h"
#ifdef HAVE_OPENSSL_DES_H
#ifdef HAVE_OPENSSL
#include <openssl/des.h>
#else
#include <des.h>
@@ -408,7 +408,7 @@ static void fb64_session(Session_Key *key, int server, struct fb *fbp)
fb64_stream_key(fbp->krbdes_key, &fbp->streams[DIR_DECRYPT-1]);
if (fbp->once == 0) {
#if !defined(OLD_DES_RANDOM_KEY) && !defined(HAVE_OPENSSL_DES_H)
#if !defined(OLD_DES_RANDOM_KEY) && !defined(HAVE_OPENSSL)
des_init_random_number_generator(&fbp->krbdes_key);
#endif
fbp->once = 1;

View File

@@ -90,7 +90,7 @@ typedef struct {
#define SK_DES 1 /* Matched Kerberos v5 KEYTYPE_DES */
#ifdef HAVE_OPENSSL_DES_H
#ifdef HAVE_OPENSSL
#include <openssl/des.h>
#define des_new_random_key des_random_key
#else

View File

@@ -220,7 +220,7 @@ kerberos4_send(char *name, Authenticator *ap)
des_key_sched(&cred.session, sched);
memcpy (&cred_session, &cred.session, sizeof(cred_session));
#ifndef HAVE_OPENSSL_DES_H
#ifndef HAVE_OPENSSL
des_init_random_number_generator(&cred.session);
#endif
des_new_random_key(&session_key);