Check for mandatory random data length if public key auth.
authorPekka Riikonen <priikone@silcnet.org>
Sat, 13 Apr 2002 17:15:58 +0000 (17:15 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 13 Apr 2002 17:15:58 +0000 (17:15 +0000)
lib/silccore/silcauth.c

index e38eff0b3b5171e918271e8fbb8c5963fc083d40..0ac793695fd70b1718f968815934841ca3f0ecb9 100644 (file)
@@ -79,6 +79,12 @@ SilcAuthPayload silc_auth_payload_parse(const unsigned char *data,
     return NULL;
   }
 
+  /* If public key authentication, random data must be at least 128 bytes */
+  if (newp->auth_method == SILC_AUTH_PUBLIC_KEY && newp->random_len < 128) {
+    silc_auth_payload_free(newp);
+    return NULL;
+  }
+
   return newp;
 }