make
[openssl.git] / crypto / pem / pem_seal.c
index ae463a301de5f7368d11d9b03d3d7e5a3fd6200d..4e554e5481e0c60cf520906671b7c2498ff8d2c1 100644 (file)
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/opensslconf.h>       /* for OPENSSL_NO_RSA */
 #ifndef OPENSSL_NO_RSA
 #include <stdio.h>
 #include "cryptlib.h"
@@ -64,6 +65,7 @@
 #include <openssl/objects.h>
 #include <openssl/x509.h>
 #include <openssl/pem.h>
+#include <openssl/rsa.h>
 
 int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type,
             unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk,
@@ -112,7 +114,7 @@ int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type,
        ret=npubk;
 err:
        if (s != NULL) OPENSSL_free(s);
-       memset(key,0,EVP_MAX_KEY_LENGTH);
+       OPENSSL_cleanse(key,EVP_MAX_KEY_LENGTH);
        return(ret);
        }