Cleanup up non-prototyped functions (static) and const-correctness in programs
diff --git a/programs/pkey/key_app.c b/programs/pkey/key_app.c
index fc0269e..051ceb5 100644
--- a/programs/pkey/key_app.c
+++ b/programs/pkey/key_app.c
@@ -1,7 +1,7 @@
 /*
  *  Key reading application
  *
- *  Copyright (C) 2006-2012, Brainspark B.V.
+ *  Copyright (C) 2006-2013, Brainspark B.V.
  *
  *  This file is part of PolarSSL (http://www.polarssl.org)
  *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
@@ -56,18 +56,8 @@
     const char *filename;       /* filename of the key file             */
     const char *password;       /* password for the private key         */
     const char *password_file;  /* password_file for the private key    */
-    int debug_level;            /* level of debugging                   */
 } opt;
 
-void my_debug( void *ctx, int level, const char *str )
-{
-    if( level < opt.debug_level )
-    {
-        fprintf( (FILE *) ctx, "%s", str );
-        fflush(  (FILE *) ctx  );
-    }
-}
-
 #define USAGE \
     "\n usage: key_app param=<>...\n"                   \
     "\n acceptable parameters:\n"                       \
@@ -75,7 +65,6 @@
     "    filename=%%s         default: keyfile.key\n"   \
     "    password=%%s         default: \"\"\n"          \
     "    password_file=%%s    default: \"\"\n"          \
-    "    debug_level=%%d      default: 0 (disabled)\n"  \
     "\n"
 
 #if !defined(POLARSSL_BIGNUM_C) || !defined(POLARSSL_RSA_C) ||         \
@@ -115,7 +104,6 @@
     opt.filename            = DFL_FILENAME;
     opt.password            = DFL_PASSWORD;
     opt.password_file       = DFL_PASSWORD_FILE;
-    opt.debug_level         = DFL_DEBUG_LEVEL;
 
     for( i = 1; i < argc; i++ )
     {
@@ -139,12 +127,6 @@
             opt.password = q;
         else if( strcmp( p, "password_file" ) == 0 )
             opt.password_file = q;
-        else if( strcmp( p, "debug_level" ) == 0 )
-        {
-            opt.debug_level = atoi( q );
-            if( opt.debug_level < 0 || opt.debug_level > 65535 )
-                goto usage;
-        }
         else
             goto usage;
     }
diff --git a/programs/pkey/key_app_writer.c b/programs/pkey/key_app_writer.c
index 746da0c..7d3a77c 100644
--- a/programs/pkey/key_app_writer.c
+++ b/programs/pkey/key_app_writer.c
@@ -1,7 +1,7 @@
 /*
  *  Key reading application
  *
- *  Copyright (C) 2006-2011, Brainspark B.V.
+ *  Copyright (C) 2006-2013, Brainspark B.V.
  *
  *  This file is part of PolarSSL (http://www.polarssl.org)
  *  Lead Maintainer: Paul Bakker <polarssl_maintainer at polarssl.org>
@@ -73,21 +73,11 @@
 {
     int mode;                   /* the mode to run the application in   */
     const char *filename;       /* filename of the key file             */
-    int debug_level;            /* level of debugging                   */
     int output_mode;            /* the output mode to use               */
     const char *output_file;    /* where to store the constructed key file  */
 } opt;
 
-void my_debug( void *ctx, int level, const char *str )
-{
-    if( level < opt.debug_level )
-    {
-        fprintf( (FILE *) ctx, "%s", str );
-        fflush(  (FILE *) ctx  );
-    }
-}
-
-void write_public_key( rsa_context *rsa, const char *output_file )
+static void write_public_key( rsa_context *rsa, const char *output_file )
 {
     FILE *f;
     unsigned char output_buf[16000];
@@ -124,7 +114,7 @@
     fclose(f);
 }
 
-void write_private_key( rsa_context *rsa, const char *output_file )
+static void write_private_key( rsa_context *rsa, const char *output_file )
 {
     FILE *f;
     unsigned char output_buf[16000];
@@ -165,7 +155,6 @@
     "\n acceptable parameters:\n"                       \
     "    mode=private|public default: none\n"           \
     "    filename=%%s         default: keyfile.key\n"   \
-    "    debug_level=%%d      default: 0 (disabled)\n"  \
     "    output_mode=private|public default: none\n"    \
     "    output_file=%%s      defeult: keyfile.pem\n"   \
     "\n"
@@ -193,7 +182,6 @@
 
     opt.mode                = DFL_MODE;
     opt.filename            = DFL_FILENAME;
-    opt.debug_level         = DFL_DEBUG_LEVEL;
     opt.output_mode         = DFL_OUTPUT_MODE;
     opt.output_file         = DFL_OUTPUT_FILENAME;
 
@@ -226,12 +214,6 @@
             opt.filename = q;
         else if( strcmp( p, "output_file" ) == 0 )
             opt.output_file = q;
-        else if( strcmp( p, "debug_level" ) == 0 )
-        {
-            opt.debug_level = atoi( q );
-            if( opt.debug_level < 0 || opt.debug_level > 65535 )
-                goto usage;
-        }
         else
             goto usage;
     }