X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fpkcs12%2Fp12_key.c;h=19285c6cee16946030cd38b0e89077fdc9e62629;hp=f1506ba1cd9f6d3b69bd45e5f63247866a7118b5;hb=b05eaeb54517d4ce77cc63415aa752cd31cea584;hpb=8d8c7266d4de9887fb0190a0770df9dc254a16a3 diff --git a/crypto/pkcs12/p12_key.c b/crypto/pkcs12/p12_key.c index f1506ba1cd..19285c6cee 100644 --- a/crypto/pkcs12/p12_key.c +++ b/crypto/pkcs12/p12_key.c @@ -57,17 +57,14 @@ */ #include -#include -#include -#include -#include -#include "pkcs12.h" +#include "cryptlib.h" +#include /* Uncomment out this line to get debugging info about key generation */ /*#define DEBUG_KEYGEN*/ #ifdef DEBUG_KEYGEN -#include +#include extern BIO *bio_err; void h__dump (unsigned char *p, int len); #endif @@ -77,10 +74,9 @@ void h__dump (unsigned char *p, int len); #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; @@ -96,10 +92,9 @@ EVP_MD *md_type; 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; @@ -177,12 +172,9 @@ EVP_MD *md_type; } 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");