Browse code

Fix compiler warnings in ssl_polarssl.c.

No functional changes, just add missing includes and make casts explicit.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1408396155-9017-1-git-send-email-steffan@karger.me>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8991
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Steffan Karger authored on 2014/08/19 06:09:15
Showing 1 changed files
... ...
@@ -40,6 +40,7 @@
40 40
 
41 41
 #include "errlevel.h"
42 42
 #include "ssl_backend.h"
43
+#include "base64.h"
43 44
 #include "buffer.h"
44 45
 #include "misc.h"
45 46
 #include "manage.h"
... ...
@@ -49,8 +50,10 @@
49 49
 
50 50
 #include "ssl_verify_polarssl.h"
51 51
 #include <polarssl/error.h>
52
+#include <polarssl/oid.h>
52 53
 #include <polarssl/pem.h>
53 54
 #include <polarssl/sha256.h>
55
+#include <polarssl/version.h>
54 56
 
55 57
 void
56 58
 tls_init_lib()
... ...
@@ -210,12 +213,13 @@ tls_ctx_restrict_ciphers(struct tls_root_ctx *ctx, const char *ciphers)
210 210
 
211 211
 void
212 212
 tls_ctx_load_dh_params (struct tls_root_ctx *ctx, const char *dh_file,
213
-    const char *dh_file_inline
213
+    const char *dh_inline
214 214
     )
215 215
 {
216
-  if (!strcmp (dh_file, INLINE_FILE_TAG) && dh_file_inline)
216
+  if (!strcmp (dh_file, INLINE_FILE_TAG) && dh_inline)
217 217
     {
218
-      if (0 != dhm_parse_dhm(ctx->dhm_ctx, dh_file_inline, strlen(dh_file_inline)))
218
+      if (0 != dhm_parse_dhm(ctx->dhm_ctx, (const unsigned char *) dh_inline,
219
+	  strlen(dh_inline)))
219 220
 	msg (M_FATAL, "Cannot read inline DH parameters");
220 221
   }
221 222
 else
... ...
@@ -257,15 +261,15 @@ tls_ctx_load_cryptoapi(struct tls_root_ctx *ctx, const char *cryptoapi_cert)
257 257
 
258 258
 void
259 259
 tls_ctx_load_cert_file (struct tls_root_ctx *ctx, const char *cert_file,
260
-    const char *cert_file_inline
260
+    const char *cert_inline
261 261
     )
262 262
 {
263 263
   ASSERT(NULL != ctx);
264 264
 
265
-  if (!strcmp (cert_file, INLINE_FILE_TAG) && cert_file_inline)
265
+  if (!strcmp (cert_file, INLINE_FILE_TAG) && cert_inline)
266 266
     {
267
-      if (0 != x509_crt_parse(ctx->crt_chain, cert_file_inline,
268
-	  strlen(cert_file_inline)))
267
+      if (0 != x509_crt_parse(ctx->crt_chain,
268
+	  (const unsigned char *) cert_inline, strlen(cert_inline)))
269 269
         msg (M_FATAL, "Cannot load inline certificate file");
270 270
     }
271 271
   else
... ...
@@ -282,16 +286,16 @@ tls_ctx_load_cert_file (struct tls_root_ctx *ctx, const char *cert_file,
282 282
 
283 283
 int
284 284
 tls_ctx_load_priv_file (struct tls_root_ctx *ctx, const char *priv_key_file,
285
-    const char *priv_key_file_inline
285
+    const char *priv_key_inline
286 286
     )
287 287
 {
288 288
   int status;
289 289
   ASSERT(NULL != ctx);
290 290
 
291
-  if (!strcmp (priv_key_file, INLINE_FILE_TAG) && priv_key_file_inline)
291
+  if (!strcmp (priv_key_file, INLINE_FILE_TAG) && priv_key_inline)
292 292
     {
293 293
       status = pk_parse_key(ctx->priv_key,
294
-	  priv_key_file_inline, strlen(priv_key_file_inline),
294
+	  (const unsigned char *) priv_key_inline, strlen(priv_key_inline),
295 295
 	  NULL, 0);
296 296
 
297 297
       if (POLARSSL_ERR_PEM_PASSWORD_REQUIRED == status)
... ...
@@ -299,7 +303,7 @@ tls_ctx_load_priv_file (struct tls_root_ctx *ctx, const char *priv_key_file,
299 299
 	  char passbuf[512] = {0};
300 300
 	  pem_password_callback(passbuf, 512, 0, NULL);
301 301
 	  status = pk_parse_key(ctx->priv_key,
302
-	      priv_key_file_inline, strlen(priv_key_file_inline),
302
+	      (const unsigned char *) priv_key_inline, strlen(priv_key_inline),
303 303
 	      (unsigned char *) passbuf, strlen(passbuf));
304 304
 	}
305 305
     }