handle building as part of openssl and libkrb5
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23561 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -45,11 +45,21 @@ RCSID("$Id$");
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <evp.h>
|
|
||||||
|
|
||||||
#include <krb5-types.h>
|
#include <krb5-types.h>
|
||||||
|
|
||||||
|
#if defined(BUILD_KRB5_LIB) && defined(HAVE_OPENSSL)
|
||||||
|
#include <openssl/evp.h>
|
||||||
|
#include <openssl/aes.h>
|
||||||
|
|
||||||
|
const EVP_CIPHER * EVP_hcrypto_aes_128_cts(void);
|
||||||
|
const EVP_CIPHER * EVP_hcrypto_aes_192_cts(void);
|
||||||
|
const EVP_CIPHER * EVP_hcrypto_aes_256_cts(void);
|
||||||
|
|
||||||
|
#else
|
||||||
|
#include <evp.h>
|
||||||
#include <aes.h>
|
#include <aes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@@ -144,7 +154,6 @@ aes_cts_do_cipher(EVP_CIPHER_CTX *ctx,
|
|||||||
unsigned int len)
|
unsigned int len)
|
||||||
{
|
{
|
||||||
AES_KEY *k = ctx->cipher_data;
|
AES_KEY *k = ctx->cipher_data;
|
||||||
unsigned char local_ivec[AES_BLOCK_SIZE], *ivec;
|
|
||||||
|
|
||||||
if (len < AES_BLOCK_SIZE)
|
if (len < AES_BLOCK_SIZE)
|
||||||
abort(); /* krb5_abortx(context, "invalid use of AES_CTS_encrypt"); */
|
abort(); /* krb5_abortx(context, "invalid use of AES_CTS_encrypt"); */
|
||||||
@@ -154,12 +163,7 @@ aes_cts_do_cipher(EVP_CIPHER_CTX *ctx,
|
|||||||
else
|
else
|
||||||
AES_decrypt(in, out, k);
|
AES_decrypt(in, out, k);
|
||||||
} else {
|
} else {
|
||||||
ivec = ctx->iv;
|
_krb5_aes_cts_encrypt(in, out, len, k, ctx->iv, ctx->encrypt);
|
||||||
if(ivec == NULL) {
|
|
||||||
memset(local_ivec, 0, sizeof(local_ivec));
|
|
||||||
ivec = local_ivec;
|
|
||||||
}
|
|
||||||
_krb5_aes_cts_encrypt(in, out, len, k, ivec, ctx->encrypt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user