#include <stdio.h>
#include <string.h>
#include <time.h>
#include <liboath/oath.h>
int main(int argc, char *argv[]){
int rc=1;
const char* secret="001122";
size_t secretlen=0;
size_t window=0;
unsigned digits=6;
char resultado[10];
time_t now, when, t0,time_step_size;
rc=oath_init(); // THE ONLY TEST TO CHECK LIBOATH LINK
if (rc == 0)
printf("liboath: %i\n",OATH_OK);
return 0;
}
Compilation command:
address@hidden:~/totp$ g++ main.cpp -loath -o teste
/tmp/ccXbve8u.o: In function `main':
main.cpp:(.text+0x45): undefined reference to `oath_init()'
collect2: error: ld returned 1 exit status
Checking library, oath_init() function is at the library as expected:
address@hidden:~/totp$ strings /usr/local/lib/liboath.so | grep oath_init
oath_init
Oathtool is also working
address@hidden:~/totp$ oathtool 0011 -v
Hex secret: 0011
Base32 secret: AAIQ====
Digits: 6
Window size: 0
Start counter: 0x0 (0)
325473