Lines Matching full:ao

52 	test_ok("AO info get: %s", tst);  in test_vefify_ao_info()
116 cmd = "AO info set: "; in setsockopt_checked()
221 test_extend(TCP_AO_ADD_KEY, false, "AO add", in extend_tests()
223 test_extend(TCP_AO_DEL_KEY, false, "AO del", in extend_tests()
225 test_extend(TCP_AO_INFO, false, "AO set info", in extend_tests()
227 test_extend(TCP_AO_INFO, true, "AO get info", -1); in extend_tests()
228 test_extend(TCP_AO_GET_KEYS, true, "AO get keys", -1); in extend_tests()
234 struct tcp_ao_add ao; in test_optmem_limit() local
241 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_optmem_limit()
248 tcp_addr_to_sockaddr_in(&ao.addr, &key_peer, 0); in test_optmem_limit()
250 &ao, sizeof(ao)); in test_optmem_limit()
273 struct tcp_ao_add ao; in test_einval_add_key() local
276 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
277 ao.keylen = TCP_AO_MAXKEYLEN + 1; in test_einval_add_key()
278 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "too big keylen"); in test_einval_add_key()
280 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
281 ao.reserved = 1; in test_einval_add_key()
282 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "using reserved padding"); in test_einval_add_key()
284 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
285 ao.reserved2 = 1; in test_einval_add_key()
286 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "using reserved2 padding"); in test_einval_add_key()
289 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
290 ao.addr.ss_family = AF_UNIX; in test_einval_add_key()
291 memcpy(&ao.addr, &SOCKADDR_ANY, sizeof(SOCKADDR_ANY)); in test_einval_add_key()
292 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "wrong address family"); in test_einval_add_key()
294 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
295 tcp_addr_to_sockaddr_in(&ao.addr, &this_ip_dest, 1234); in test_einval_add_key()
296 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "port (unsupported)"); in test_einval_add_key()
298 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
299 ao.prefix = 0; in test_einval_add_key()
300 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "no prefix, addr"); in test_einval_add_key()
302 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
303 ao.prefix = 0; in test_einval_add_key()
304 memcpy(&ao.addr, &SOCKADDR_ANY, sizeof(SOCKADDR_ANY)); in test_einval_add_key()
305 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, 0, "no prefix, any addr"); in test_einval_add_key()
307 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
308 ao.prefix = 32; in test_einval_add_key()
309 memcpy(&ao.addr, &SOCKADDR_ANY, sizeof(SOCKADDR_ANY)); in test_einval_add_key()
310 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "prefix, any addr"); in test_einval_add_key()
312 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
313 ao.prefix = 129; in test_einval_add_key()
314 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "too big prefix"); in test_einval_add_key()
316 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
317 ao.prefix = 2; in test_einval_add_key()
318 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "too short prefix"); in test_einval_add_key()
320 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
321 ao.keyflags = (uint8_t)(-1); in test_einval_add_key()
322 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "bad key flags"); in test_einval_add_key()
324 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
326 ao.set_current = 1; in test_einval_add_key()
327 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "add current key on a listen socket"); in test_einval_add_key()
329 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
331 ao.set_rnext = 1; in test_einval_add_key()
332 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "add rnext key on a listen socket"); in test_einval_add_key()
334 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
336 ao.set_current = 1; in test_einval_add_key()
337 ao.set_rnext = 1; in test_einval_add_key()
338 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "add current+rnext key on a listen socket"); in test_einval_add_key()
340 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
341 ao.set_current = 1; in test_einval_add_key()
342 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, 0, "add key and set as current"); in test_einval_add_key()
344 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
345 ao.set_rnext = 1; in test_einval_add_key()
346 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, 0, "add key and set as rnext"); in test_einval_add_key()
348 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
349 ao.set_current = 1; in test_einval_add_key()
350 ao.set_rnext = 1; in test_einval_add_key()
351 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, 0, "add key and set as current+rnext"); in test_einval_add_key()
353 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
354 ao.ifindex = 42; in test_einval_add_key()
355 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, in test_einval_add_key()
358 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
359 ao.keyflags |= TCP_AO_KEYF_IFINDEX; in test_einval_add_key()
360 ao.ifindex = 42; in test_einval_add_key()
361 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "non-existent VRF"); in test_einval_add_key()
370 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
371 ao.maclen = 100; in test_einval_add_key()
372 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EMSGSIZE, "maclen bigger than TCP hdr"); in test_einval_add_key()
374 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
375 strcpy(ao.alg_name, "imaginary hash algo"); in test_einval_add_key()
376 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, ENOENT, "bad algo"); in test_einval_add_key()
532 setsockopt_checked(sk, TCP_AO_INFO, &info, 0, "ao required"); in test_einval_ao_info()
534 if (!should_skip_test("ao required with MD5 key", KCONFIG_TCP_MD5)) { in test_einval_ao_info()
543 "ao required with MD5 key"); in test_einval_ao_info()
765 struct tcp_ao_add ao, ao2; in duplicate_tests() local
768 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
769 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
771 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: full copy"); in duplicate_tests()
773 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
774 ao2 = ao; in duplicate_tests()
777 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao2, sizeof(ao))) in duplicate_tests()
779 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: any addr key on the socket"); in duplicate_tests()
781 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
782 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
784 memcpy(&ao.addr, &SOCKADDR_ANY, sizeof(SOCKADDR_ANY)); in duplicate_tests()
785 ao.prefix = 0; in duplicate_tests()
786 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: add any addr key"); in duplicate_tests()
790 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
791 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
793 if (test_prepare_def_key(&ao, "password", 0, network_dup, in duplicate_tests()
796 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: add any addr for the same subnet"); in duplicate_tests()
798 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
799 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
801 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: full copy of a key"); in duplicate_tests()
803 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
804 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
806 ao.rcvid = 101; in duplicate_tests()
807 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: RecvID differs"); in duplicate_tests()
809 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
810 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
812 ao.sndid = 101; in duplicate_tests()
813 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: SendID differs"); in duplicate_tests()