Lines Matching full:ao

54 	test_ok("AO info get: %s", tst);  in test_vefify_ao_info()
118 cmd = "AO info set: "; in setsockopt_checked()
223 test_extend(TCP_AO_ADD_KEY, false, "AO add", in extend_tests()
225 test_extend(TCP_AO_DEL_KEY, false, "AO del", in extend_tests()
227 test_extend(TCP_AO_INFO, false, "AO set info", in extend_tests()
229 test_extend(TCP_AO_INFO, true, "AO get info", -1); in extend_tests()
230 test_extend(TCP_AO_GET_KEYS, true, "AO get keys", -1); in extend_tests()
236 struct tcp_ao_add ao; in test_optmem_limit() local
243 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_optmem_limit()
250 tcp_addr_to_sockaddr_in(&ao.addr, &key_peer, 0); in test_optmem_limit()
252 &ao, sizeof(ao)); in test_optmem_limit()
275 struct tcp_ao_add ao; in test_einval_add_key() local
278 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
279 ao.keylen = TCP_AO_MAXKEYLEN + 1; in test_einval_add_key()
280 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "too big keylen"); in test_einval_add_key()
282 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
283 ao.reserved = 1; in test_einval_add_key()
284 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "using reserved padding"); in test_einval_add_key()
286 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
287 ao.reserved2 = 1; in test_einval_add_key()
288 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "using reserved2 padding"); in test_einval_add_key()
291 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
292 ao.addr.ss_family = AF_UNIX; in test_einval_add_key()
293 memcpy(&ao.addr, &SOCKADDR_ANY, sizeof(SOCKADDR_ANY)); in test_einval_add_key()
294 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "wrong address family"); in test_einval_add_key()
296 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
297 tcp_addr_to_sockaddr_in(&ao.addr, &this_ip_dest, 1234); in test_einval_add_key()
298 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "port (unsupported)"); in test_einval_add_key()
300 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
301 ao.prefix = 0; in test_einval_add_key()
302 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "no prefix, addr"); in test_einval_add_key()
304 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
305 ao.prefix = 0; in test_einval_add_key()
306 memcpy(&ao.addr, &SOCKADDR_ANY, sizeof(SOCKADDR_ANY)); in test_einval_add_key()
307 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, 0, "no prefix, any addr"); in test_einval_add_key()
309 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
310 ao.prefix = 32; in test_einval_add_key()
311 memcpy(&ao.addr, &SOCKADDR_ANY, sizeof(SOCKADDR_ANY)); in test_einval_add_key()
312 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "prefix, any addr"); in test_einval_add_key()
314 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
315 ao.prefix = 129; in test_einval_add_key()
316 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "too big prefix"); in test_einval_add_key()
318 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
319 ao.prefix = 2; in test_einval_add_key()
320 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "too short prefix"); in test_einval_add_key()
322 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
323 ao.keyflags = (uint8_t)(-1); in test_einval_add_key()
324 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "bad key flags"); in test_einval_add_key()
326 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
328 ao.set_current = 1; in test_einval_add_key()
329 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "add current key on a listen socket"); in test_einval_add_key()
331 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
333 ao.set_rnext = 1; in test_einval_add_key()
334 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "add rnext key on a listen socket"); in test_einval_add_key()
336 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
338 ao.set_current = 1; in test_einval_add_key()
339 ao.set_rnext = 1; in test_einval_add_key()
340 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "add current+rnext key on a listen socket"); in test_einval_add_key()
342 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
343 ao.set_current = 1; in test_einval_add_key()
344 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, 0, "add key and set as current"); in test_einval_add_key()
346 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
347 ao.set_rnext = 1; in test_einval_add_key()
348 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, 0, "add key and set as rnext"); in test_einval_add_key()
350 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
351 ao.set_current = 1; in test_einval_add_key()
352 ao.set_rnext = 1; in test_einval_add_key()
353 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, 0, "add key and set as current+rnext"); in test_einval_add_key()
355 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
356 ao.ifindex = 42; in test_einval_add_key()
357 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, in test_einval_add_key()
360 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
361 ao.keyflags |= TCP_AO_KEYF_IFINDEX; in test_einval_add_key()
362 ao.ifindex = 42; in test_einval_add_key()
363 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EINVAL, "non-existent VRF"); in test_einval_add_key()
372 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
373 ao.maclen = 100; in test_einval_add_key()
374 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EMSGSIZE, "maclen bigger than TCP hdr"); in test_einval_add_key()
376 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in test_einval_add_key()
377 strcpy(ao.alg_name, "imaginary hash algo"); in test_einval_add_key()
378 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, ENOENT, "bad algo"); in test_einval_add_key()
534 setsockopt_checked(sk, TCP_AO_INFO, &info, 0, "ao required"); in test_einval_ao_info()
536 if (!should_skip_test("ao required with MD5 key", KCONFIG_TCP_MD5)) { in test_einval_ao_info()
545 "ao required with MD5 key"); in test_einval_ao_info()
767 struct tcp_ao_add ao, ao2; in duplicate_tests() local
770 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
771 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
773 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: full copy"); in duplicate_tests()
775 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
776 ao2 = ao; in duplicate_tests()
779 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao2, sizeof(ao))) in duplicate_tests()
781 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: any addr key on the socket"); in duplicate_tests()
783 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
784 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
786 memcpy(&ao.addr, &SOCKADDR_ANY, sizeof(SOCKADDR_ANY)); in duplicate_tests()
787 ao.prefix = 0; in duplicate_tests()
788 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: add any addr key"); in duplicate_tests()
792 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
793 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
795 if (test_prepare_def_key(&ao, "password", 0, network_dup, in duplicate_tests()
798 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: add any addr for the same subnet"); in duplicate_tests()
800 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
801 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
803 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: full copy of a key"); in duplicate_tests()
805 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
806 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
808 ao.rcvid = 101; in duplicate_tests()
809 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: RecvID differs"); in duplicate_tests()
811 sk = prepare_defs(TCP_AO_ADD_KEY, &ao); in duplicate_tests()
812 if (setsockopt(sk, IPPROTO_TCP, TCP_AO_ADD_KEY, &ao, sizeof(ao))) in duplicate_tests()
814 ao.sndid = 101; in duplicate_tests()
815 setsockopt_checked(sk, TCP_AO_ADD_KEY, &ao, EEXIST, "duplicate: SendID differs"); in duplicate_tests()