-/* crypto/rsa/rsa_saos.c */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
*/
#include <stdio.h>
-#include "cryptlib.h"
+#include "internal/cryptlib.h"
#include <openssl/bn.h>
#include <openssl/rsa.h>
#include <openssl/objects.h>
RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY);
return (0);
}
- s = (unsigned char *)OPENSSL_malloc((unsigned int)j + 1);
+ s = OPENSSL_malloc((unsigned int)j + 1);
if (s == NULL) {
RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING, ERR_R_MALLOC_FAILURE);
return (0);
else
*siglen = i;
- OPENSSL_cleanse(s, (unsigned int)j + 1);
- OPENSSL_free(s);
+ OPENSSL_clear_free(s, (unsigned int)j + 1);
return (ret);
}
return (0);
}
- s = (unsigned char *)OPENSSL_malloc((unsigned int)siglen);
+ s = OPENSSL_malloc((unsigned int)siglen);
if (s == NULL) {
RSAerr(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING, ERR_R_MALLOC_FAILURE);
goto err;
} else
ret = 1;
err:
- if (sig != NULL)
- M_ASN1_OCTET_STRING_free(sig);
- if (s != NULL) {
- OPENSSL_cleanse(s, (unsigned int)siglen);
- OPENSSL_free(s);
- }
+ ASN1_OCTET_STRING_free(sig);
+ OPENSSL_clear_free(s, (unsigned int)siglen);
return (ret);
}