struct config_st *ykcore_config;
};
-void _yktest_hexdump(char *prefix, void *buffer, int size, int break_on)
+void _yktest_hexdump(const char *prefix, const void *buffer, int size, int break_on)
{
unsigned char *p = buffer;
int i;
assert(config_matches_expected == true);
}
-int _test_config (YKP_CONFIG *cfg, YK_STATUS *st, int argc, char **argv)
+int _test_config (YKP_CONFIG *cfg, YK_STATUS *st, int argc, const char **argv)
{
const char *infname = NULL;
const char *outfname = NULL;
* Utility function to parse arguments and just return the result code.
* The calling function does the assert() to get function name in assert output.
*/
-int _parse_args_rc(int argc, char *argv[])
+int _parse_args_rc(int argc, const char *argv[])
{
YKP_CONFIG *cfg = ykp_alloc();
YK_STATUS *st = _test_init_st(2, 2, 0);
0x00, 0x46, 0xc0
};
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-1",
NULL
};
0x00, 0xe9, 0xf5
};
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-2", "-a303132333435363738393a3b3c3d3e3f",
NULL
};
YK_STATUS *st = _test_init_st(1, 3, 0);
int rc = 0;
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-oshort-ticket",
NULL
};
YK_STATUS *st = _test_init_st(2, 2, 0);
int rc = 0;
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-oticket-first",
NULL
};
unsigned char scan_map[sizeof(SCAN_MAP)];
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-1", "-sout", "-iin", "-c313233343536", "-y", "-v",
NULL
};
0x00, 0x6a, 0xb9
};
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-1", "-a303132333435363738393a3b3c3d3e3f40414243", "-ooath-hotp", "-o-append-cr",
NULL
};
0x00, 0x03, 0x95, 0x56, 0x00, 0x00, 0x00,
};
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-2", "-a303132333435363738393a3b3c3d3e3f40414243",
"-ochal-resp", "-ochal-hmac", "-ohmac-lt64", "-oserial-api-visible",
NULL
void _test_two_slots1(void)
{
/* Test that it is not possible to choose slot more than once */
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-1", "-1",
NULL
};
void _test_two_slots2(void)
{
/* Test that it is not possible to choose slot more than once */
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-2", "-1",
NULL
};
void _test_two_modes_at_once1(void)
{
/* Test that it is not possible to choose mode (OATH-HOTP/CHAL-RESP) more than once */
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-ochal-resp", "-ooath-hotp",
NULL
};
void _test_two_modes_at_once2(void)
{
/* Test that it is not possible to choose mode (OATH-HOTP/CHAL-RESP) more than once */
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-ochal-resp", "-ochal-resp",
NULL
};
void _test_mode_after_other_option(void)
{
/* Test that it is not possible to set mode after other options */
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-ohmac-lt64", "-ochal-resp",
NULL
};
/* Make sure key with mixed case is rejected (parsing function yubikey_hex_decode
* only handles lower case hex)
*/
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-1", "-a0000000000000000000000000000000E",
NULL
};
void _test_uid_for_oath(void)
{
/* Test that it is not possible to specify UID with OATH */
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-ooath-hotp", "-ouid=h:010203040506",
NULL
};
void _test_uid_for_chal_resp(void)
{
/* Test that it is not possible to specify UID with Challenge Response */
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-ochal-resp", "-ouid=h:010203040506",
NULL
};
void _test_swap_with_slot(void)
{
/* Test that you can not both swap and set slot */
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-x", "-1",
NULL
};
void _test_slot_with_update(void)
{
/* Test the update must be before slot */
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-1", "-u",
NULL
};
void _test_swap_with_update(void)
{
/* Test the update must be before slot */
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-u", "-x",
NULL
};
YKP_CONFIG *cfg = ykp_alloc();
YK_STATUS *st = _test_init_st(2, 1, 7);
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-nhttps://my.yubico.com/neo/",
NULL
};
YKP_CONFIG *cfg = ykp_alloc();
YK_STATUS *st = _test_init_st(2, 2, 4);
- char *argv[] = {
+ const char *argv[] = {
"unittest", "-nhttps://my.yubico.com/neo/",
NULL
};
YKP_CONFIG *cfg = ykp_alloc();
YK_STATUS *st = _test_init_st(2, 1, 7);
- char *argv[] = {
+ const const char *argv[] = {
"unittest", "-2", NULL
};
int argc = 2;
YKP_CONFIG *cfg = ykp_alloc();
YK_STATUS *st = _test_init_st(2, 1, 7);
- char *argv[] = {
+ const const char *argv[] = {
"unittest", "-2", "-nhttps://my.yubico.com/neo/",
+ NULL
};
int argc = 2;
YKP_CONFIG *cfg = ykp_alloc();
YK_STATUS *st = _test_init_st(3, 0, 0);
- char *argv[] = {
+ const const char *argv[] = {
"unittest", "-2", "-nhttps://my.yubico.com/neo/",
NULL
};