Add sanity checks when generating new RSA keys.
[tinc] / src / protocol_auth.c
index 04674e8..0904afd 100644 (file)
@@ -1,7 +1,7 @@
 /*
     protocol_auth.c -- handle the meta-protocol, authentication
     Copyright (C) 1999-2005 Ivo Timmermans,
-                  2000-2013 Guus Sliepen <guus@tinc-vpn.org>
+                  2000-2014 Guus Sliepen <guus@tinc-vpn.org>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -379,7 +379,8 @@ bool id_h(connection_t *c, const char *request) {
                }
 
                if(experimental)
-                       read_ecdsa_public_key(c);
+                       if(!read_ecdsa_public_key(c))
+                               return false;
        } else {
                if(c->protocol_minor && !ecdsa_active(c->ecdsa))
                        c->protocol_minor = 1;