When parsing the configuration. initialize the auth structure
authorreyk <reyk@openbsd.org>
Wed, 20 Jul 2016 12:31:00 +0000 (12:31 +0000)
committerreyk <reyk@openbsd.org>
Wed, 20 Jul 2016 12:31:00 +0000 (12:31 +0000)
correctly, as parse.y's $$ is not zero-initialized.

Found by Rene Ammerlaan

OK markus@ florian@

sbin/iked/parse.y

index db43864..5f93f07 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.55 2016/06/21 21:35:24 benno Exp $        */
+/*     $OpenBSD: parse.y,v 1.56 2016/07/20 12:31:00 reyk Exp $ */
 
 /*
  * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -811,15 +811,19 @@ ipcomp            : /* empty */                   { $$ = 0; }
 
 ikeauth                : /* empty */                   {
                        $$.auth_method = IKEV2_AUTH_RSA_SIG;
+                       $$.auth_eap = 0;
                        $$.auth_length = 0;
                }
                | RSA                           {
                        $$.auth_method = IKEV2_AUTH_RSA_SIG;
+                       $$.auth_eap = 0;
                        $$.auth_length = 0;
                }
                | PSK keyspec                   {
                        memcpy(&$$, &$2, sizeof($$));
                        $$.auth_method = IKEV2_AUTH_SHARED_KEY_MIC;
+                       $$.auth_eap = 0;
+                       $$.auth_length = 0;
                }
                | EAP STRING                    {
                        unsigned int i;