X-Git-Url: https://git.strongswan.org/?p=strongswan.git;a=blobdiff_plain;f=scripts%2Ftimeattack.c;h=3d7ffee7d332d0ee7726033dfc2e6a22fc0e59e2;hp=0a53abae9f3a3b2eb4e657145a0c5760890381c5;hb=b833963270fbffe3186f5c71c7584c2347a44038;hpb=39e1ddec2ed3480e0edc07bbabfacbf907dc4e3f diff --git a/scripts/timeattack.c b/scripts/timeattack.c index 0a53aba..3d7ffee 100644 --- a/scripts/timeattack.c +++ b/scripts/timeattack.c @@ -196,6 +196,12 @@ CALLBACK(attack_memeq4, bool, return !m; } +CALLBACK(attack_memeq5, bool, + u_char *subj, u_char *data, size_t len) +{ + return memeq_const(subj, data, len); +} + static bool attack_memeq(char *name, u_int iterations, u_int distance) { struct { @@ -206,6 +212,7 @@ static bool attack_memeq(char *name, u_int iterations, u_int distance) { "memeq2", attack_memeq2 }, { "memeq3", attack_memeq3 }, { "memeq4", attack_memeq4 }, + { "memeq5", attack_memeq5 }, }; u_char exp[16]; int i; @@ -350,7 +357,7 @@ int main(int argc, char *argv[]) if (argc < 3) { fprintf(stderr, "usage: %s \n", argv[0]); - fprintf(stderr, " : memeq[1-4] / aead / signer\n"); + fprintf(stderr, " : memeq[1-5] / aead / signer\n"); fprintf(stderr, " : number of invocations * 1000\n"); fprintf(stderr, " : time difference in ns for a hit\n"); fprintf(stderr, " example: %s memeq1 100 500\n", argv[0]);