# define BIO_new_fp BIO_new_fp_internal
# else /* FP_API */
BIO_METHOD *BIO_s_file(void );
-BIO *BIO_new_file(char *filename, char *mode);
+BIO *BIO_new_file(const char *filename, const char *mode);
BIO *BIO_new_fp(FILE *stream, int close_flag);
# define BIO_s_file_internal BIO_s_file
# define BIO_new_file_internal BIO_new_file
return bio_write(bio, str, strlen(str));
}
-
+/* Until bio_make_pair is used, make a dummy function use it for -pedantic */
+void dummy() { bio_make_pair(NULL,NULL); }
static int bio_make_pair(BIO *bio1, BIO *bio2)
{
file_free,
};
-BIO *BIO_new_file(char *filename, char *mode)
+BIO *BIO_new_file(const char *filename, const char *mode)
{
BIO *ret;
FILE *file;
(unsigned char *)(x))
#define d2i_DHparams_bio(bp,x) (DH *)ASN1_d2i_bio((char *(*)())DH_new, \
(char *(*)())d2i_DHparams,(bp),(unsigned char **)(x))
+#ifdef __cplusplus
+#define i2d_DHparams_bio(bp,x) ASN1_i2d_bio((int (*)())i2d_DHparams,(bp), \
+ (unsigned char *)(x))
+#else
#define i2d_DHparams_bio(bp,x) ASN1_i2d_bio(i2d_DHparams,(bp), \
(unsigned char *)(x))
+#endif
DH * DH_new(void);
void DH_free(DH *dh);
ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md,
int en_de);
int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
- unsigned char *salt, int saltlen, int iter,
- int keylen, unsigned char *out);
+ unsigned char *salt, int saltlen, int iter,
+ int keylen, unsigned char *out);
int PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
ASN1_TYPE *param, EVP_CIPHER *cipher, EVP_MD *md,
int en_de);
*/
int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
- unsigned char *salt, int saltlen, int iter,
- int keylen, unsigned char *out)
+ unsigned char *salt, int saltlen, int iter,
+ int keylen, unsigned char *out)
{
unsigned char digtmp[SHA_DIGEST_LENGTH], *p, itmp[4];
int cplen, j, k;
#include <string.h>
#include <openssl/hmac.h>
-void HMAC_Init(HMAC_CTX *ctx, const unsigned char *key, int len,
+void HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
const EVP_MD *md)
{
int i,j,reset=0;
memset(ctx,0,sizeof(HMAC_CTX));
}
-unsigned char *HMAC(const EVP_MD *evp_md, const unsigned char *key, int key_len,
- unsigned char *d, int n, unsigned char *md, unsigned int *md_len)
+unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
+ unsigned char *d, int n, unsigned char *md,
+ unsigned int *md_len)
{
HMAC_CTX c;
static unsigned char m[EVP_MAX_MD_SIZE];
#define HMAC_size(e) (EVP_MD_size((e)->md))
-void HMAC_Init(HMAC_CTX *ctx, const unsigned char *key, int len,
+void HMAC_Init(HMAC_CTX *ctx, const void *key, int len,
const EVP_MD *md);
void HMAC_Update(HMAC_CTX *ctx,unsigned char *key, int len);
void HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
void HMAC_cleanup(HMAC_CTX *ctx);
-unsigned char *HMAC(const EVP_MD *evp_md, const unsigned char *key, int key_len,
- unsigned char *d, int n, unsigned char *md, unsigned int *md_len);
+unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
+ unsigned char *d, int n, unsigned char *md,
+ unsigned int *md_len);
#ifdef __cplusplus
else
x= *x509p;
- rsa=RSA_generate_key(bits,RSA_F4,callback);
+ rsa=RSA_generate_key(bits,RSA_F4,callback,NULL);
if (!EVP_PKEY_assign_RSA(pk,rsa))
{
abort();