Merge branch 'master' into next
[paraslash.git] / user_list.c
index 840802b..3c0b4f8 100644 (file)
@@ -6,6 +6,7 @@
 
 /** \file user_list.c User handling for para_server. */
 
 
 /** \file user_list.c User handling for para_server. */
 
+#include <regex.h>
 #include <sys/types.h>
 #include <dirent.h>
 #include <openssl/rc4.h>
 #include <sys/types.h>
 #include <dirent.h>
 #include <openssl/rc4.h>
@@ -55,6 +56,11 @@ static void populate_user_list(char *user_list_file)
                                para_strerror(-ret));
                        continue;
                }
                                para_strerror(-ret));
                        continue;
                }
+               if (ret < CHALLENGE_SIZE + 2 * CHALLENGE_SIZE + 41) {
+                       PARA_WARNING_LOG("rsa key for %s too small\n", n);
+                       rsa_free(rsa);
+                       continue;
+               }
                u = para_malloc(sizeof(*u));
                u->name = para_strdup(n);
                u->rsa = rsa;
                u = para_malloc(sizeof(*u));
                u->name = para_strdup(n);
                u->rsa = rsa;