aes_init_key() broken for enc==-1

2002-02-24 Thread Markus Friedl


This patch is needed for EVP+AES

--- crypto/evp/e_aes.c  Sat Feb 16 13:39:53 2002
+++ crypto/evp/e_aes.c  Sun Feb 24 16:54:59 2002
@@ -88,6 +88,8 @@
 static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
   const unsigned char *iv, int enc) {
 
+   if (enc == -1)
+   enc = ctx-encrypt;
if (enc) 
AES_set_encrypt_key(key, ctx-key_len * 8, ctx-cipher_data);
else


otherwise code similar to this will break:

EVP_CIPHER_CTX c;

EVP_CIPHER_CTX_init(c);
EVP_CipherInit(c, cipher, NULL, iv, enc);
/* adjust keylength */
EVP_CIPHER_CTX_set_key_length(c, keylen)
EVP_CipherInit(c, NULL, key, NULL, -1);

There could be problems in other ciphers, too.
__
OpenSSL Project http://www.openssl.org
Development Mailing List   [EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



[STATUS] OpenSSL (Sun 24-Feb-2002)

2002-02-24 Thread OpenSSL Project


  OpenSSL STATUS   Last modified at
  __   $Date: 2002/02/21 17:23:04 $

  DEVELOPMENT STATE

o  OpenSSL 0.9.7:  Under development...
o  OpenSSL 0.9.6c: Released on December  21st, 2001
o  OpenSSL 0.9.6b: Released on July   9th, 2001
o  OpenSSL 0.9.6a: Released on April  5th, 2001
o  OpenSSL 0.9.6:  Released on September 24th, 2000
o  OpenSSL 0.9.5a: Released on April  1st, 2000
o  OpenSSL 0.9.5:  Released on February  28th, 2000
o  OpenSSL 0.9.4:  Released on August09th, 1999
o  OpenSSL 0.9.3a: Released on May   29th, 1999
o  OpenSSL 0.9.3:  Released on May   25th, 1999
o  OpenSSL 0.9.2b: Released on March 22th, 1999
o  OpenSSL 0.9.1c: Released on December  23th, 1998

  RELEASE SHOWSTOPPERS

o BIGNUM library failures on 64-bit platforms (0.9.7-dev):
  - BN_mod_mul verificiation (bc) fails for solaris64-sparcv9-cc

Checked on  Result
alpha-cc (Tru64 version 4.0)works
linux-alpha+bwx-gcc doesn't work. Reported by
Sean O'Riordain [EMAIL PROTECTED]

Needs checked on
[add platforms here]

  AVAILABLE PATCHES

o 

  IN PROGRESS

o Steve is currently working on (in no particular order):
ASN1 code redesign, butchery, replacement.
OCSP
EVP cipher enhancement.
Enhanced certificate chain verification.
Private key, certificate and CRL API and implementation.
Developing and bugfixing PKCS#7 (S/MIME code).
Various X509 issues: character sets, certificate request extensions.
o Geoff and Richard are currently working on:
ENGINE (the new code that gives hardware support among others).
o Richard is currently working on:
UI (User Interface)
UTIL (a new set of library functions to support some higher level
  functionality that is currently missing).
Shared library support for VMS.
Kerberos 5 authentication
Constification
OCSP

  NEEDS PATCH

o  An (optional) countermeasure against the predictable-IV CBC
   weakness in SSL/TLS should be added; see
   http://www.openssl.org/~bodo/tls-cbc.txt

o  apps/ca.c: Sign the certificate? - n creates empty certificate file

o  Whenever strncpy is used, make sure the resulting string is NULL-terminated
   or an error is reported

o  OpenSSL STATUS is never up-to-date.

  OPEN ISSUES

o  The Makefile hierarchy and build mechanism is still not a round thing:

   1. The config vs. Configure scripts
  It's the same nasty situation as for Apache with APACI vs.
  src/Configure. It confuses.
  Suggestion: Merge Configure and config into a single configure
  script with a Autoconf style interface ;-) and remove
  Configure and config. Or even let us use GNU Autoconf
  itself. Then we can avoid a lot of those platform checks
  which are currently in Configure.

o  Support for Shared Libraries has to be added at least
   for the major Unix platforms. The details we can rip from the stuff
   Ralf has done for the Apache src/Configure script. Ben wants the
   solution to be really simple.

   Status: Ralf will look how we can easily incorporate the
   compiler PIC and linker DSO flags from Apache
   into the OpenSSL Configure script.

   Ulf: +1 for using GNU autoconf and libtool (but not automake,
which apparently is not flexible enough to generate
libcrypto)


o  The perl/ stuff needs a major overhaul. Currently it's
   totally obsolete. Either we clean it up and enhance it to be up-to-date
   with the C code or we also could replace it with the really nice
   Net::SSLeay package we can find under
   http://www.neuronio.pt/SSLeay.pm.html.  Ralf uses this package for a
   longer time and it works fine and is a nice Perl module. Best would be
   to convince the author to work for the OpenSSL project and create a
   Net::OpenSSL or Crypt::OpenSSL package out of it and maintains it for
   us.

   Status: Ralf thinks we should both contact the author of Net::SSLeay
   and look how much effort it is to bring Eric's perl/ stuff up
   to date.
   Paul +1

  WISHES

o  Add variants of DH_generate_parameters() and BN_generate_prime() [etc?]
   where the callback function can request that the function be aborted.
   [Gregory Stark [EMAIL PROTECTED], [EMAIL PROTECTED]]

o  SRP in TLS.
   [wished by:
Dj [EMAIL PROTECTED], Tom Wu [EMAIL PROTECTED],
Tom Holroyd [EMAIL PROTECTED]]

   See http://search.ietf.org/internet-drafts/draft-ietf-tls-srp-00.txt
   as well as 

Re: aes_init_key() broken for enc==-1

2002-02-24 Thread Dr S N Henson

Markus Friedl wrote:
 
 This patch is needed for EVP+AES
 
 --- crypto/evp/e_aes.c  Sat Feb 16 13:39:53 2002
 +++ crypto/evp/e_aes.c  Sun Feb 24 16:54:59 2002
 @@ -88,6 +88,8 @@
  static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc) {
 
 +   if (enc == -1)
 +   enc = ctx-encrypt;
 if (enc)
 AES_set_encrypt_key(key, ctx-key_len * 8, ctx-cipher_data);
 else
 
 otherwise code similar to this will break:
 
 EVP_CIPHER_CTX c;
 
 EVP_CIPHER_CTX_init(c);
 EVP_CipherInit(c, cipher, NULL, iv, enc);
 /* adjust keylength */
 EVP_CIPHER_CTX_set_key_length(c, keylen)
 EVP_CipherInit(c, NULL, key, NULL, -1);
 
 There could be problems in other ciphers, too.

You can't do that with AES anyway because its treated as a fixed key
length cipher with the key length determined by the EVP_CIPHER
structure. It has to be handled that way because unlike other cases
(e.g. RC2) the ASN1 OIDs are different for each key length.

I don't think any other ciphers are currently affected but it would be
an idea to have equivalent functionality in the EVP_CipherInit_ex()
function.

Steve.
-- 
Dr Stephen N. Henson.   http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED] 
Senior crypto engineer, Gemplus: http://www.gemplus.com/
Core developer of the   OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.

__
OpenSSL Project http://www.openssl.org
Development Mailing List   [EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]