Re: [openssl-dev] [openssl.org #3922] Bug: EVP_get_digestbynid() does not support ECDSA

2015-07-02 Thread David von Oheimb via RT
Thanks a lot Steve for your constructive comments.

 That's expected behaviour. The EVP_get_digestbynid funtion expects a digest 
 NID
 whereas you are passing a signature NID instead. It does accept some signature
 NIDs for historical compatibility reasons.

I now understand that the code I extended for EC support was abusing
EVP_get_digestbynid(), which worked just for compatibility reasons for
RSA (only). Yet why not broaden this function (or better its underlying
mapping) to handle ECDSA (and possibly any other types of) signatures.

 The thread you mention shows you how to convert a signature NID into the 
 digest
 and public key algorithm NID.

The hint you gave in that thread was to use  OBJ_find_sigid_algs()
and this indeed works fine and is cleaner :-)

 However I suspect you shouldn't be trying to do things at that level for
 signatures. If you need to sign or verify ASN.1 data you can use 
 ASN1_item_sign
 or ASN1_item_verify and key and digest handling and lookup is handled 
 automatically.

Good point that they better should have used a more high-level
signature/verification function. Yet the proposed functions, as well as
ASN1_sign and ASN1_verify, still require the (plain) md parameter.
And for instance the more abstract function
  int PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si)
uses again
  md = EVP_get_digestbyobj(si-digest_alg-algorithm);
such that the use of OBJ_find_sigid_algs() appears indispensable.

David.


___
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev


[openssl-dev] [openssl.org #3922] Bug: EVP_get_digestbynid() does not support ECDSA

2015-06-22 Thread David von Oheimb via RT
Hi OpenSSL maintainers,

I tried checking the status of the EVP_get_digestbynid issue via
http://rt.openssl.org/Install/index.html
but the server appears currently misconfigured:
 Config file /etc/request-tracker4/RT_SiteConfig.pm is locked 

Yet I found an old conversation on this topic:
http://openssl.6102.n7.nabble.com/Question-about-EVP-get-digestbynid-and-ECDSA-td28312.html

With OpenSSL 1.0.2 one still gets NULL when giving ECDSA NIDs as input.
Here is the workaround we currently use for EC support in CMPforOpenSSL:

 const EVP_MD *extended_EVP_get_digestbynid(int nid) {
 switch (nid) {
 case  NID_ecdsa_with_SHA1:
 return EVP_sha1();
 case  NID_ecdsa_with_SHA224:
 return EVP_sha224();
 case  NID_ecdsa_with_SHA256:
 return EVP_sha256();
 case  NID_ecdsa_with_SHA384:
 return EVP_sha384();
 case  NID_ecdsa_with_SHA512:
 return EVP_sha512();
 default:
 return EVP_get_digestbynid(nid);
   }
 }

I just commented on this issue also at
https://sourceforge.net/p/cmpforopenssl/bugs/14/

Regards,
David

--
+---+
|  Dr. David von OheimbSenior Key Expert Research Scientist|
|  Siemens CT RTC ITS SEA-DE   Phone: +49 89 636 41173 |
|  Otto-Hahn-Ring 6Fax  : +49 89 636 48000 |
|  D-81739 München, GermanyEMail: david.von.ohe...@siemens.com |
|  http://scd.siemens.de/db4/lookUp?tcgid=Z000ECRO   http://ddvo.net/  |
+--+

___
openssl-bugs-mod mailing list
openssl-bugs-...@openssl.org
https://mta.openssl.org/mailman/listinfo/openssl-bugs-mod
___
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev


[openssl.org #3180] Brainpool Elliptic Curves in OpenSSL version 1.0.2 - Re: #2239: [PATCH] RFC 5639 support

2013-11-25 Thread David von Oheimb via RT
Hello OpenSSL team,

patches extending OpenSSL's built-in set of EC curves by the Brainpool
curves (see RFC 5639) have been around since 2010 - see for instance
http://openssl.6102.n7.nabble.com/openssl-org-2359-PATCH-td41171.html
http://rt.openssl.org/Ticket/Display.html?id=2239user=guestpass=guest

Pleased to see that finally, three years later, they have been included
in the upcoming version 1.0.2. - I have been able to verify this from
http://mirrors.ibiblio.org/openssl/snapshot/openssl-1.0.2-stable-SNAP-20131125.tar.gz

In particular since the usual NIST curves got under pressure recently:
http://it.slashdot.org/firehose.pl?op=viewtype=storysid=13/09/11/1224252
it is important to have some less debatable alternatives available for
general use ASAP. When can we expect version 1.0.2 to be released?


BTW, I successfully applied to both openssl-1.0.1c and 1.0.1e the
http://rt.openssl.org/Ticket/Attachment/32178/16797/rfc5639.patch .
When using it to cross-compile for Windows under Linux using the
ms/mingw32-cross.sh script, the dependencies of
crypto/objects/obj_dat.h and crypto/objects/obj_dat.c on
crypto/objects/obj_mac.h are not properly reflected.
As a workaround to this problem, I inserted between the lines

 echo Building the libraries
 make -f ms/mingw32-cross.mak CROSS=${CROSS}

the extra two lines

 make crypto/objects/obj_dat.h
 if [ crypto/objects/obj_dat.h -nt crypto/objects/obj_dat.c ]; then touch 
 crypto/objects/obj_dat.c; fi

How does one cross-compile OpenSSL v1.0.2 for 32-bit Windows under
Linux? Both ./Configure Cygwin and ./Configure mingw
lead to various errors with 'make depend'.

Best regards
David von Oheimb

__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org