Make the RSA structure opaque
[openssl.git] / crypto / rsa / rsa_oaep.c
index 0f742f9969a55e530491f563390b5d08c37242f6..27a6e78823fe14999d1e0c2284a5c0deec623892 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/rsa/rsa_oaep.c */
 /*
  * Written by Ulf Moeller. This software is distributed on an "AS IS" basis,
  * WITHOUT WARRANTY OF ANY KIND, either express or implied.
 #include <stdio.h>
 #include "internal/cryptlib.h"
 #include <openssl/bn.h>
-#include <openssl/rsa.h>
 #include <openssl/evp.h>
 #include <openssl/rand.h>
 #include <openssl/sha.h>
+#include "rsa_locl.h"
 
 int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
                                const unsigned char *from, int flen,
@@ -242,7 +241,7 @@ int PKCS1_MGF1(unsigned char *mask, long len,
 {
     long i, outlen = 0;
     unsigned char cnt[4];
-    EVP_MD_CTX *c = EVP_MD_CTX_create();
+    EVP_MD_CTX *c = EVP_MD_CTX_new();
     unsigned char md[EVP_MAX_MD_SIZE];
     int mdlen;
     int rv = -1;
@@ -274,6 +273,6 @@ int PKCS1_MGF1(unsigned char *mask, long len,
     }
     rv = 0;
  err:
-    EVP_MD_CTX_destroy(c);
+    EVP_MD_CTX_free(c);
     return rv;
 }