]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Don't ask for PSK if we don't have credentials for it.
authorSimon Josefsson <simon@josefsson.org>
Tue, 6 Feb 2007 15:54:43 +0000 (15:54 +0000)
committerSimon Josefsson <simon@josefsson.org>
Tue, 6 Feb 2007 15:54:43 +0000 (15:54 +0000)
src/cli.c

index ec34f594847d2751642dd65702705b9e7b106083..091efdc8c66aaa523d5bdb40a71637703cc0a304 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -839,6 +839,23 @@ gaa_parser (int argc, char **argv)
            }
        }
     }
+
+
+  if (!psk_username || !psk_key.data)
+    {
+      size_t i;
+      for (i = 0; kx_priority[i]; i++)
+       {
+         if (kx_priority[i] == GNUTLS_KX_DHE_PSK ||
+             kx_priority[i] == GNUTLS_KX_PSK)
+           {
+             memmove (&kx_priority[i],
+                      &kx_priority[i+1],
+                      sizeof (*kx_priority) * (PRI_MAX - i - 1));
+             i--;
+           }
+       }
+    }
 }
 
 void