#include <daemon.h>
#include <library.h>
+#define MAX_TRIES 3
+
ENUM(sim_subtype_names, SIM_START, SIM_CLIENT_ERROR,
"SIM_START",
"SIM_CHALLENGE",
void *handle;
/**
+ * how many times we try to authenticate
+ */
+ int tries;
+
+ /**
* version this implementation uses
*/
chunk_t version;
signer_t *signer;
hasher_t *hasher;
prf_t *prf;
+
+ if (this->tries-- <= 0)
+ {
+ /* give up without notification. This hack is required as some buggy
+ * server implementations won't respect our client-error. */
+ return FAILED;
+ }
identifier = in->get_identifier(in);
message = in->get_data(in);
/* private data */
this->peer = peer;
+ this->tries = MAX_TRIES;
this->version.ptr = version;
this->version.len = sizeof(version);
this->version_list = chunk_empty;