*** empty log message ***
[openssl.git] / crypto / pkcs12 / p12_key.c
index f1506ba1cd9f6d3b69bd45e5f63247866a7118b5..19285c6cee16946030cd38b0e89077fdc9e62629 100644 (file)
  */
 
 #include <stdio.h>
  */
 
 #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
 
 
 /* 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
 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
 
 #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;
 {
        int ret;
        unsigned char *unipass;
@@ -96,10 +92,9 @@ EVP_MD *md_type;
        return ret;
 }
 
        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;
 {
        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);
                }
        }
                        } else BN_bn2bin (Ij, I + j);
                }
        }
-       return 0; /* This can't happen */
 }
 #ifdef DEBUG_KEYGEN
 }
 #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");     
 {
        for (; len --; p++) BIO_printf (bio_err, "%02X", *p);
        BIO_printf (bio_err, "\n");