Enc doesn't support AEAD ciphers.
[openssl.git] / demos / x509 / mkreq.c
index d69dcc392b9ff6e94f0c1c4ae39fe0f1a7bc0dbc..d1cba9dc5a6d393444f78b23101afdaf7b3436c7 100644 (file)
@@ -7,11 +7,14 @@
 
 #include <openssl/pem.h>
 #include <openssl/conf.h>
+#include <openssl/x509.h>
 #include <openssl/x509v3.h>
+#ifndef OPENSSL_NO_ENGINE
 #include <openssl/engine.h>
+#endif
 
 int mkreq(X509_REQ **x509p, EVP_PKEY **pkeyp, int bits, int serial, int days);
-int add_ext(STACK_OF(X509_REQUEST) *sk, int nid, char *value);
+int add_ext(STACK_OF(X509_EXTENSION) *sk, int nid, char *value);
 
 int main(int argc, char **argv)
        {
@@ -33,7 +36,9 @@ int main(int argc, char **argv)
        X509_REQ_free(req);
        EVP_PKEY_free(pkey);
 
+#ifndef OPENSSL_NO_ENGINE
        ENGINE_cleanup();
+#endif
        CRYPTO_cleanup_all_ex_data();
 
        CRYPTO_mem_leaks(bio_err);
@@ -130,7 +135,7 @@ int mkreq(X509_REQ **req, EVP_PKEY **pkeyp, int bits, int serial, int days)
 
 #endif
        
-       if (!X509_REQ_sign(x,pk,EVP_md5()))
+       if (!X509_REQ_sign(x,pk,EVP_sha1()))
                goto err;
 
        *req=x;
@@ -144,7 +149,7 @@ err:
  * because we wont reference any other sections.
  */
 
-int add_ext(STACK_OF(X509_REQUEST) *sk, int nid, char *value)
+int add_ext(STACK_OF(X509_EXTENSION) *sk, int nid, char *value)
        {
        X509_EXTENSION *ex;
        ex = X509V3_EXT_conf_nid(NULL, NULL, nid, value);