#include <stdio.h>
#include "cryptlib.h"
#include <openssl/rand.h>
-#ifndef NO_RSA
+#ifndef OPENSSL_NO_RSA
#include <openssl/rsa.h>
#endif
#include <openssl/evp.h>
unsigned char key[EVP_MAX_KEY_LENGTH];
int i;
- if (npubk <= 0) return(0);
if(type) {
EVP_CIPHER_CTX_init(ctx);
- EVP_EncryptInit(ctx,type,NULL,NULL);
+ if(!EVP_EncryptInit(ctx,type,NULL,NULL)) return 0;
}
+ if (npubk <= 0) return(0);
if (RAND_bytes(key,EVP_MAX_KEY_LENGTH) <= 0)
return(0);
if (EVP_CIPHER_CTX_iv_length(ctx))