*/
#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <err.h>
-#include <bn.h>
-#include "pkcs12.h"
+#include "cryptlib.h"
+#include <openssl/pkcs12.h>
/* Uncomment out this line to get debugging info about key generation */
/*#define DEBUG_KEYGEN*/
#ifdef DEBUG_KEYGEN
-#include <bio.h>
+#include <openssl/bio.h>
extern BIO *bio_err;
void h__dump (unsigned char *p, int len);
#endif
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif
-int PKCS12_key_gen_asc (pass, passlen, salt, saltlen, id, iter, n, out, md_type)
-unsigned char *pass, *salt, *out;
-int passlen, saltlen, id, iter, n;
-EVP_MD *md_type;
+int PKCS12_key_gen_asc (const char *pass, int passlen, unsigned char *salt,
+ int saltlen, int id, int iter, int n, unsigned char *out,
+ const EVP_MD *md_type)
{
int ret;
unsigned char *unipass;
return ret;
}
-int PKCS12_key_gen_uni (pass, passlen, salt, saltlen, id, iter, n, out, md_type)
-unsigned char *pass, *salt, *out;
-int passlen, saltlen, id, iter, n;
-EVP_MD *md_type;
+int PKCS12_key_gen_uni (unsigned char *pass, int passlen, unsigned char *salt,
+ int saltlen, int id, int iter, int n, unsigned char *out,
+ const EVP_MD *md_type)
{
unsigned char *B, *D, *I, *p, *Ai;
int Slen, Plen, Ilen;
} else BN_bn2bin (Ij, I + j);
}
}
- return 0; /* This can't happen */
}
#ifdef DEBUG_KEYGEN
-void h__dump (p, len)
-unsigned char *p;
-int len;
+void h__dump (unsigned char *p, int len)
{
for (; len --; p++) BIO_printf (bio_err, "%02X", *p);
BIO_printf (bio_err, "\n");