-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
executable file
·50 lines (41 loc) · 1.3 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"qst_authen.h"
unsigned char secret_key_1[32] =
{
0x77, 0x77, 0x77, 0x2E, 0x31, 0x30, 0x30, 0x30,
0x76, 0x69, 0x64, 0x65, 0x2E, 0x63, 0x6F, 0x6D,
0x2E, 0x63, 0x6E, 0x2D, 0x32, 0x30, 0x31, 0x39,
0x30, 0x32, 0x31, 0x32, 0x2D, 0x4E, 0x30, 0x32
};
unsigned char challenge_date[32] =
{
0x31, 0xAE, 0x02, 0xE3, 0xB1, 0xC2, 0x74, 0xCF,
0x5E, 0xA7, 0x08, 0x40, 0x85, 0x31, 0x30, 0x5D,
0x9E, 0xF1, 0x31, 0x99, 0x79, 0x0B, 0x0B, 0x5E,
0x0D, 0x7A, 0x2F, 0xB0, 0x68, 0x1A, 0xCC, 0x2E
};
int main()
{
int i;
int ret = 0;
unsigned char buf[88];
IC_INFO *info = (IC_INFO *)malloc(sizeof(IC_INFO));
IC_OPT *opt = (IC_OPT *)malloc(sizeof(IC_OPT));
memset(info, 0x0, sizeof(IC_INFO));
memset(opt, 0x0, sizeof(IC_OPT));
qst_authen_on();
qst_authen_get_version(info);
printf("otp: \nflag:%s \ntime:%s \nverion:%s\n", info->id, info->time, info->version);
qst_authen_get_option(opt);
printf("opt: \nmaster_opt:%x\nminor_opt:%x\n", opt->master_opt, opt->minor_opt);
while(qst_authen_verify(secret_key_1, challenge_date, 0x01, 1)){
qst_authen_off();
printf("check succ \n");
return 0;
}
qst_authen_off();
printf("check fail \n");
return -1;
}