diff options
author | Matt Johnston <matt@ucc.asn.au> | 2010-02-27 11:53:18 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2010-02-27 11:53:18 +0000 |
commit | ddbfdb079991e9705c8874ae2d2dbd64394f269c (patch) | |
tree | 6358929d48902659b423493edf17831541c732ac /svr-auth.c | |
parent | 85288d7b6174b78af903fb55593bccd0014e5f30 (diff) | |
parent | 3b078445482f42dabfe4922e67a958dc607b166f (diff) |
merge of '48fdaa8706d1acda35e9d564adc9a1fbc96c18c8'
and '658fd03abd21e0da7c4c89b9fff9dc693c72daae'
--HG--
extra : convert_revision : 8064882fcaa13d586651021462b9014b74332107
Diffstat (limited to 'svr-auth.c')
-rw-r--r-- | svr-auth.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -33,6 +33,7 @@ #include "packet.h" #include "auth.h" #include "runopts.h" +#include "random.h" static void authclear(); static int checkusername(unsigned char *username, unsigned int userlen); @@ -337,7 +338,12 @@ void send_msg_userauth_failure(int partial, int incrfail) { encrypt_packet(); if (incrfail) { - usleep(300000); /* XXX improve this */ + unsigned int delay; + genrandom((unsigned char*)&delay, sizeof(delay)); + /* We delay for 300ms +- 50ms, 0.1ms granularity */ + delay = 250000 + (delay % 1000)*100; + usleep(delay); + dropbear_log(LOG_INFO, "delay is %d", delay); ses.authstate.failcount++; } |