From nobody Wed Jul 30 17:36:36 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bsfXl54Xxz62pMp; Wed, 30 Jul 2025 17:36:55 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bsfXk3zl0z3v4Z; Wed, 30 Jul 2025 17:36:54 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=clkRI+Pa; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2a00:1450:4864:20::52c as permitted sender) smtp.mailfrom=rick.macklem@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-60bfcada295so9729a12.1; Wed, 30 Jul 2025 10:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753897008; x=1754501808; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1O9V2ZXJpiDvLtiYOkcHyp2VpS6nH9DIQK3XDv+pveM=; b=clkRI+PaGKgrXvT6qGrNQr3To5xnBC0C8XsP1Xo8KyliC2QMdmyeSwXjQ7trYiz2pS 59SDmziD3Ulh5thd94heKCDXvJkwpejNLe6fCc6LOKa9Ga02pgiRg/5/D8jU2e3EwAKU QS115XxBwLJ9/3Wd6QwKjF01mxKvI51alvYttY0IiNi63G0QXl+Wu0hXO23AETkCnTsf yvq7ItS3y4BUHlN3lBgp+6iN/172aeE2owBMsxE89HJsT5ndxQsdR3MnKjUkznvRj/jZ 7VBAHWZsxV2EAaaDVj8JcblXnkgz9RPqgMENrfCFHHlQmIdQtBbLaNWubzw45hF6XFJY GT+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753897008; x=1754501808; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1O9V2ZXJpiDvLtiYOkcHyp2VpS6nH9DIQK3XDv+pveM=; b=bJBh6k7a9O2rFPuqzYRHMiu+tB20kVkONCGLSedYyXNHdubo6Yai5ZA7I+G6FwnaPm /DFmU/IlmtLuZx1NOZKlQzrjn0zVorVcM18Oww9X2duD1O6MH3TxKlqJY2K9hE+YuZox s/+xpSbYz6VLfZkxe23ShzSDUo4ujwT/tVVstBsi81JHOEJeAv9UL3L3Wbl6dxeX5Mbc XYDQ4QoNKU9k5USuoWTCCZECRXEH1QPW+tqeN+hlgIMvXroe0/JhbZOR4NAKZyQMHoeQ FxhbbGaljlAYaOkwWsPLSVg3uQo0m8jlNacClUYXZNaBB5CAbisq8OX+6g06PL/AeBb4 Sagw== X-Forwarded-Encrypted: i=1; AJvYcCVI8gxafWUvqcffMy3QtD0mGCX8Ez2bh5cgyZoMgGK+nL76dc05Yqac7WIGRoJ2OZOrxGyVbThhb25wyMTXUlVOThOF1cY=@freebsd.org, AJvYcCVPe9CKM48cTng5L40xGD7BdwDqtTzpTONo3thk6QY1iVTgLntNSiSo5OywCZoHNJ1lMgPUA3cnu9Fm9cadoEU=@freebsd.org, AJvYcCVgziFnBMwSQy/nXV8yNPvWUf9ElqSxHGXT4GXVFJS/wh6xUaF20cntOgmRJ6dF/WftCQ==@freebsd.org, AJvYcCVmlq3rcoKcu1mI7unBjd6mrgd7KDUneE0REUKHCNHkiR7xLN0xO8OhlEFyQqv4qRkxwEfxiilX@freebsd.org, AJvYcCWiq62s6ZGKNycP4hEr7XeLX8bvjZ0RAk96kg+acqI25K/FCC6nZwEf9NfH6UQZffhRFfvCza+CtEYsb0Vu1xljhg2Mgg==@freebsd.org X-Gm-Message-State: AOJu0YwxPFCYKkHWW4z/3aYDIPBBev7LXGEfYyDfQTIAOebDDRyROJK/ PyWqP9DXPxgpEIMYYjyFK3GtmwA6EMQEulGUBmX4CwETsH6vjsIDddyItstDrACHP6nvJ64IAN7 D58M5Fcm0BImwxKg+WhEUvBcmOLc8lA== X-Gm-Gg: ASbGncvWpbkA1cH20Q5Kcp6O6vgZIlAwBN4Uq64ufilnhiW4VlTcLbAMtPrX1EJ/+gQ tRXU9Cx3Ut+sSd91FWUpj7U5px6Ojqf4Ls7OlSTYlyWgsPlcRn5b7OOlkdG59JBT4RR4GfheYg4 bxbHRhXfSy5it1swa85kT5gaUJW0ueFlMxXWNVE2fiVTBHsgI/RCIsdMVNc+L53UvYTJHAnZdS2 6/TT8s4uwp/JtwREiaoBkElnp3EXnxfUoIfvQ== X-Google-Smtp-Source: AGHT+IGCTcVcxROpJotGsjlK81aeBx7mTsZE5U7WaX2WTTIF+JO+u2tdJZC/i7A4Jm+H21uPZrBui48mP+bR0OfBO50= X-Received: by 2002:a05:6402:308d:b0:608:f493:871c with SMTP id 4fb4d7f45d1cf-61586f12252mr3466408a12.14.1753897007849; Wed, 30 Jul 2025 10:36:47 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202507211410.56LEAD6J066633@gitrepo.freebsd.org> <47C3CC37-6F32-4376-900A-B5387B9817D5@freebsd.org> <20250721144645.3BA391BE@slippy.cwsent.com> <20250722155941.AC7EB121@slippy.cwsent.com> In-Reply-To: From: Rick Macklem Date: Wed, 30 Jul 2025 10:36:36 -0700 X-Gm-Features: Ac12FXxtmqDl-TyfirfyXO0tbBQWAynfayVPtp-duqGPAWupDJNDVxVru28pJSk Message-ID: Subject: Re: git: c7da9fb90b0b - main - KRB5: Enable MIT KRB5 by default To: Benjamin Kaduk Cc: Konstantin Belousov , Cy Schubert , Jessica Clarke , Cy Schubert , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[text/plain]; TO_DN_EQ_ADDR_SOME(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ARC_NA(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; TAGGED_FROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,cschubert.com,freebsd.org]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCPT_COUNT_SEVEN(0.00)[8]; MISSING_XM_UA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::52c:from] X-Rspamd-Queue-Id: 4bsfXk3zl0z3v4Z X-Spamd-Bar: --- On Mon, Jul 28, 2025 at 3:32=E2=80=AFPM Benjamin Kaduk = wrote: > > On Mon, Jul 28, 2025 at 3:04=E2=80=AFPM Benjamin Kaduk wrote: >> >> >> Note that MIT krb5 provides the gss_krb5_export_lucid_sec_context() API = that does a lot of the work of getting useful bits out of an established GS= S security context. >> > > > > > And a bit more context on what is going on here and why kgssapi has to ca= re: > The GSS-API (RFC 2743) is all about a way to "establish a security contex= t" (i.e., do crypto negotiation, authentication, sometimes authorization, e= tc.) between two entities, the initiator and the acceprot, and then exchang= ing protected messages between the two (which can be either encrypted or ju= st integrity protection tags for otherweise cleartext data); later extensio= ns included the ability to produce identical PRF output on both parties, et= c.. The details are "mechanism-specific", and for this purpose we're exclu= sively talking about the krb5 mechanism. The steps to establish the securi= ty context are complicated and sometimes fiddly, and in the general case ca= n require a large number of round-trips between the initiator and acceptor = before the security context is established. The individual message-protect= ion parts are comparatively simple and amendable to implementation in the k= ernel for processing efficiency. > RFC 2743 also defines functions for GSS_Export_sec_context() and GSS_Impo= rt_sec_context(), that are designed essentially to pass information about a= n established security context from one process to another on the same mach= ine (which are presumably using the same implementation and version of the = implementation), so the contents of the exported blob are opaque and implem= entation-specific. We are abusing that mechanism to export information abo= ut the security context that gssd has established and feed that information= into the kernel implementation of the per-message processing routines. At= present, this necessarily entails knowing the details of the implementatio= n-specific opaque blob that is the "export sec context token", which is wha= t the sys/kgssapi/krb5/krb5_mech.c code is doing. But if we can get the in= formation we want without breaking the abstraction barrier, such as via the= gss_krb5_export_lucid_sec_context() API, we are in a more robust posture o= verall and somewhat future-proofed against future evolution by MIT krb5. > (I note that recent Heimdal versions seem to also expose a gss_krb5_expor= t_lucid_sec_context() API, so part of the problem is just that the Heimdal = in base is so old.) Well, here's some "not so good" news... I've been trying to use gss_inquire_sec_context_by_oid(..) with the oid for the GSS_KRB5_EXPORT_LUCID_SEC_CONTEXT_OID with version 1. It kept failing. The problem seems to be that "gctx->proto =3D=3D 4" in make_external_lucid_= ctx_v1() function. This function only knows about the 0 and 1 setting for gctx->prot= o. Any ideas, rick > > -Ben