From 02ba530437bfbfdddf56de010d62a5ff453813ae Mon Sep 17 00:00:00 2001 From: Dan McDonald Date: Tue, 12 Sep 2017 16:06:19 -0400 Subject: OS-6333 sadb_x_kmc_t's KM cookie should be 64-bits Reviewed by: Jason King Reviewed by: Robert Mustacchi Approved by: Jerry Jelinek --- usr/src/lib/libipsecutil/common/ipsec_util.c | 39 +++- usr/src/lib/libipsecutil/common/ipsec_util.h | 5 +- usr/src/pkg/manifests/system-test-ostest.mf | 2 + usr/src/test/os-tests/tests/pf_key/Makefile | 7 +- usr/src/test/os-tests/tests/pf_key/kmc-update.sh | 68 +++++++ usr/src/test/os-tests/tests/pf_key/kmc-updater.c | 226 +++++++++++++++++++++++ usr/src/uts/common/inet/ip/sadb.c | 47 +++-- usr/src/uts/common/inet/ipsec_impl.h | 2 +- usr/src/uts/common/inet/sadb.h | 6 +- usr/src/uts/common/net/pfkeyv2.h | 8 +- 10 files changed, 384 insertions(+), 26 deletions(-) create mode 100644 usr/src/test/os-tests/tests/pf_key/kmc-update.sh create mode 100644 usr/src/test/os-tests/tests/pf_key/kmc-updater.c diff --git a/usr/src/lib/libipsecutil/common/ipsec_util.c b/usr/src/lib/libipsecutil/common/ipsec_util.c index ad9410b8b4..343a4f0a1b 100644 --- a/usr/src/lib/libipsecutil/common/ipsec_util.c +++ b/usr/src/lib/libipsecutil/common/ipsec_util.c @@ -23,6 +23,7 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright 2012 Milan Juri. All rights reserved. + * Copyright 2017 Joyent, Inc. */ #include @@ -1152,6 +1153,9 @@ error: * not found). Note that the returned label pointer points to a static * string, so the label will be overwritten by a subsequent call to the * function; the function is also not thread-safe as a result. + * + * Because this is possibly publically exported, do not change its name, + * but this is for all intents and purposes an IKEv1/in.iked function. */ char * kmc_lookup_by_cookie(int cookie) @@ -2591,13 +2595,38 @@ print_kmc(FILE *file, char *prefix, struct sadb_x_kmc *kmc) { char *cookie_label; - if ((cookie_label = kmc_lookup_by_cookie(kmc->sadb_x_kmc_cookie)) == - NULL) - cookie_label = dgettext(TEXT_DOMAIN, "