Re: AES counter mode support missing from EVP

2008-05-05 Thread Jan Pechanec
On Tue, 29 Apr 2008, Dr. Stephen Henson wrote:

  the problem is that now one can't offload AES counter modes to the 
 engine unless the application itself specifies its own EVP functions and 
 structures. However, even then, counter mode IDs and names are missing from 
 obj*.h files so functions like OBJ_nid2sn() crash. That happens with 
 openssl engine -c, for example. It is enough to add following 3 lines to 
 objects.txt so that AES counter mode can be offloaded to the engine using 
 the workaround mentioned:
 
 : AES-128-CTR   : aes-128-ctr
 : AES-192-CTR   : aes-192-ctr
 : AES-256-CTR   : aes-256-ctr
 

It would be better is standard OIDs existed for these modes and those were
added instead.

You can create OIDs dynamically with OBJ_create() too, that should work
without the need to modify OpenSSL at all.

aha, thanks, that's a good idea. It seems to me that I can't use 
OBJ_create() without providing an OID but ASN1_OBJECT_create() + 
OBJ_add_object() is OK for me and no phony OIDs are used then.

J.

-- 
Jan Pechanec
__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   [EMAIL PROTECTED]


AES counter mode support missing from EVP

2008-04-29 Thread Jan Pechanec

hi,

I can see that EVP API doesn't support AES counter mode. My guess is 
that it might be because of the fact that current EVP API doesn't have a 
parameter for counter length. Is that the reason or is it something else?

the problem is that now one can't offload AES counter modes to the 
engine unless the application itself specifies its own EVP functions and 
structures. However, even then, counter mode IDs and names are missing from 
obj*.h files so functions like OBJ_nid2sn() crash. That happens with 
openssl engine -c, for example. It is enough to add following 3 lines to 
objects.txt so that AES counter mode can be offloaded to the engine using 
the workaround mentioned:

: AES-128-CTR   : aes-128-ctr
: AES-192-CTR   : aes-192-ctr
: AES-256-CTR   : aes-256-ctr

I'm happy to file a bug and post a patch but I'd like to know if 
there is anything I'm missing. I searched through the archives but I didn't 
see any discussion related to the AES counter mode with regard to EVP API.

and to put it to some context - SSH protocol always uses 128 bits 
long counter for AES counter mode so that's why OpenSSH can work with its 
own EVP functions for this mode. However, above mentioned changes are needed 
so that CTR mode can be offloaded to the engine.

thanks, Jan.

-- 
Jan Pechanec
__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: AES counter mode support missing from EVP

2008-04-29 Thread Dr. Stephen Henson
On Tue, Apr 29, 2008, Jan Pechanec wrote:

 
   hi,
 
   I can see that EVP API doesn't support AES counter mode. My guess is 
 that it might be because of the fact that current EVP API doesn't have a 
 parameter for counter length. Is that the reason or is it something else?
 

Nobody having time to develop it is the main reason. The lack of a parameter
isn't a problem for EVP many cipher specific parameters can be set using the
ctrl mechanism.

   the problem is that now one can't offload AES counter modes to the 
 engine unless the application itself specifies its own EVP functions and 
 structures. However, even then, counter mode IDs and names are missing from 
 obj*.h files so functions like OBJ_nid2sn() crash. That happens with 
 openssl engine -c, for example. It is enough to add following 3 lines to 
 objects.txt so that AES counter mode can be offloaded to the engine using 
 the workaround mentioned:
 
 : AES-128-CTR   : aes-128-ctr
 : AES-192-CTR   : aes-192-ctr
 : AES-256-CTR   : aes-256-ctr
 

It would be better is standard OIDs existed for these modes and those were
added instead.

You can create OIDs dynamically with OBJ_create() too, that should work
without the need to modify OpenSSL at all.

Steve.
--
Dr Stephen N. Henson. Email, S/MIME and PGP keys: see homepage
OpenSSL project core developer and freelance consultant.
Homepage: http://www.drh-consultancy.demon.co.uk
__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   [EMAIL PROTECTED]