David Howells 283e8ba2df MODSIGN: Change from CMS to PKCS#7 signing if the openssl is too old
The sign-file.c program actually uses CMS rather than PKCS#7 to sign a file
since that allows the target X.509 certificate to be specified by
subjectKeyId rather than by issuer + serialNumber.

However, older versions of the OpenSSL crypto library (such as may be found
in CentOS 5.11) don't support CMS.  Assume everything prior to
OpenSSL-1.0.0 doesn't support CMS and switch to using PKCS#7 in that case.

Further, the pre-1.0.0 OpenSSL only supports PKCS#7 signing with SHA1, so
give an error from the sign-file script if the caller requests anything
other than SHA1.

The compiler gives the following error with an OpenSSL crypto library
that's too old:

  HOSTCC  scripts/sign-file
scripts/sign-file.c:23:25: fatal error: openssl/cms.h: No such file or directory
 #include <openssl/cms.h>

Reported-by: Vinson Lee <vlee@twopensource.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
2015-09-25 16:31:46 +01:00
..
2015-08-20 14:57:47 +02:00
2015-09-04 11:25:03 +02:00
2014-08-20 16:03:45 +02:00
2014-08-20 16:03:45 +02:00
2011-08-31 16:12:17 +02:00
2014-08-20 16:03:45 +02:00
2014-08-20 16:03:45 +02:00
2014-08-20 16:03:45 +02:00
2012-06-27 12:44:29 -07:00
2010-03-23 12:26:38 +01:00
2014-12-20 00:01:12 +01:00
2015-09-04 13:14:10 +02:00
2014-08-20 16:03:45 +02:00
2014-08-20 16:03:45 +02:00
2015-08-28 17:04:40 +02:00
2015-08-28 17:04:40 +02:00
2009-06-09 22:37:54 +02:00
2014-08-20 16:03:45 +02:00