Added SILC Server library.
[silc.git] / lib / silcutil / silcapputil.c
index 415d591fd22691142a3d606bc02deff916ce7554..d1d6739ff751b56e8f8173e93273d18a21f9b1cb 100644 (file)
@@ -18,7 +18,7 @@
 */
 /* $Id$ */
 
-#include "silcincludes.h"
+#include "silc.h"
 
 static char *silc_create_pk_identifier(void)
 {
@@ -54,7 +54,7 @@ static char *silc_create_pk_identifier(void)
 
 /* Generate key pair */
 
-bool silc_create_key_pair(const char *pkcs_name,
+SilcBool silc_create_key_pair(const char *pkcs_name,
                          SilcUInt32 key_len_bits,
                          const char *pub_filename,
                          const char *prv_filename,
@@ -63,7 +63,7 @@ bool silc_create_key_pair(const char *pkcs_name,
                          SilcPKCS *return_pkcs,
                          SilcPublicKey *return_public_key,
                          SilcPrivateKey *return_private_key,
-                         bool interactive)
+                         SilcBool interactive)
 {
   SilcPKCS pkcs;
   SilcPublicKey pub_key;
@@ -182,7 +182,7 @@ New pair of keys will be created.  Please, answer to following questions.\n\
         pass = strdup("");
        break;
       } else {
-       bool match;
+       SilcBool match;
        printf("\n");
        pass2 = silc_get_input("Retype private key passphrase: ", TRUE);
        if (!pass2)
@@ -197,7 +197,7 @@ New pair of keys will be created.  Please, answer to following questions.\n\
   }
 
   /* Generate keys */
-  silc_pkcs_alloc(alg, &pkcs);
+  silc_pkcs_alloc(alg, SILC_PKCS_SILC, &pkcs);
   silc_pkcs_generate_key(pkcs, key_len_bits, rng);
 
   /* Save public key into file */
@@ -251,7 +251,7 @@ New pair of keys will be created.  Please, answer to following questions.\n\
 
 /* Load key pair */
 
-bool silc_load_key_pair(const char *pub_filename,
+SilcBool silc_load_key_pair(const char *pub_filename,
                        const char *prv_filename,
                        const char *passphrase,
                        SilcPKCS *return_pkcs,
@@ -290,7 +290,7 @@ bool silc_load_key_pair(const char *pub_filename,
     }
 
   if (return_pkcs) {
-    silc_pkcs_alloc((*return_public_key)->name, return_pkcs);
+    silc_pkcs_alloc((*return_public_key)->name, SILC_PKCS_SILC, return_pkcs);
     silc_pkcs_public_key_set(*return_pkcs, *return_public_key);
     silc_pkcs_private_key_set(*return_pkcs, *return_private_key);
   }
@@ -302,7 +302,7 @@ bool silc_load_key_pair(const char *pub_filename,
 
 /* Dump public key into stdout */
 
-bool silc_show_public_key(const char *pub_filename)
+SilcBool silc_show_public_key(const char *pub_filename)
 {
   SilcPublicKey public_key;
   SilcPublicKeyIdentifier ident;
@@ -326,7 +326,7 @@ bool silc_show_public_key(const char *pub_filename)
   fingerprint = silc_hash_fingerprint(NULL, pk, pk_len);
   babbleprint = silc_hash_babbleprint(NULL, pk, pk_len);
 
-  if (silc_pkcs_alloc(public_key->name, &pkcs)) {
+  if (silc_pkcs_alloc(public_key->name, SILC_PKCS_SILC, &pkcs)) {
     key_len = silc_pkcs_public_key_set(pkcs, public_key);
     silc_pkcs_free(pkcs);
   }
@@ -363,12 +363,12 @@ bool silc_show_public_key(const char *pub_filename)
 
 /* Change private key passphrase */
 
-bool silc_change_private_key_passphrase(const char *prv_filename,
+SilcBool silc_change_private_key_passphrase(const char *prv_filename,
                                        const char *old_passphrase,
                                        const char *new_passphrase)
 {
   SilcPrivateKey private_key;
-  bool base64 = FALSE;
+  SilcBool base64 = FALSE;
   char *pass;
 
   pass = old_passphrase ? strdup(old_passphrase) : NULL;