Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k2fzV-0001Wd-38 for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Aug 2020 19:19:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k2fzT-0004Eo-VY for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Aug 2020 19:19:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k2fzR-0004Eg-Gv for pgsql-hackers@lists.postgresql.org; Mon, 03 Aug 2020 19:19:18 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k2fz3-00053w-5W for pgsql-hackers@lists.postgresql.org; Mon, 03 Aug 2020 19:19:16 +0000 Received: by mail-qk1-x744.google.com with SMTP id d14so36183798qke.13 for ; Mon, 03 Aug 2020 12:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:autocrypt:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=YCJeGC80QiAIcDB/XUMcgTj9NWLM5G7qJJI4ojrn128=; b=UmLtRazELm4BCFIgGTHKmwCOhWbEHFwHM8zSZ/SPG5gwL7X4a0O32OLPeic7MoXEAQ oy0VJD+ZBdK7oi/rP+CAeu+mGSSxs83b9G8nr8xtnr7zGryuavMAC76TCFE3cypEZmwa dqnGpltZlikxE79OrxiTEL7ejVQ52R2Ww7+190up4BYYSUJra3JhhpPxPbCBWZHcKM3V 1HLY99daglhGKLzIFzLbF/9CcWe3+o1NN6jd4KnfZNMw2AEd9oKpQvb7UcuMwkEH83Lj 0IMTDABIcsFC3eM9fMd3hmlLHPV9U0bIAgAelvVyNsj1Np1eGvUaUpOwKAhaS+hvajZ+ zc7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language; bh=YCJeGC80QiAIcDB/XUMcgTj9NWLM5G7qJJI4ojrn128=; b=OM8e6d5BCRSYHCQPIJTIS/I3pNbo0H3H0sgTWdjLItyFKJs8xkMSqA7H0lF9qHOA1h G0ojlR1ggDOrhBxbMRjXzEMdgmS+VTXzYXPZAysDk/fMwG45LWLNn1lmghNW13i5a9cj 43Bk5Of5+SA0JNxUOguT501kOV6Z7/2cHDthEuD8D3G5Jey5y32XS21MOVYV0aOcQGEl MgUE0vCj9eBxEhUaywQyPuzinsQ6LfzfRutWjcj/61/vTCCF9guNaIqGqVuNjIq54JK1 AtA8aZAvOvLkW//gmFXOZ+ylC/BSHua9jtSrdo9tkaOqFO/4NTshlqqs9Fc3htk3YL1D M/0A== X-Gm-Message-State: AOAM532uWwMUon5iVCHLfRFRv/KOQv64dCtTJPlhGYZOj9dNHOReXzD/ uP+Ic78FwvKKSJV0KyJn+6s6 X-Google-Smtp-Source: ABdhPJwPYe9/fDlIjuCXOAdpKvPCu+cEN9BN2zhW5gZaFtuAJFsb1eFI0KFiKFE0yujC+uBE0kXZRw== X-Received: by 2002:a05:620a:10ab:: with SMTP id h11mr17333340qkk.219.1596482331860; Mon, 03 Aug 2020 12:18:51 -0700 (PDT) Received: from ?IPv6:2600:1700:722:4630::43? ([2600:1700:722:4630::43]) by smtp.gmail.com with ESMTPSA id y24sm21485595qtv.71.2020.08.03.12.18.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Aug 2020 12:18:49 -0700 (PDT) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: Support for NSS as a libpq TLS backend To: Daniel Gustafsson Cc: Postgres hackers , Stephen Frost References: <08B1D888-6151-4002-B0C2-488893AB51B2@yesql.se> Autocrypt: addr=andrew.dunstan@2ndQuadrant.com; prefer-encrypt=mutual; keydata= mQENBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65FwGSEj526yiKLocqkJceSq Xr9xcA5SGY+FZv441chh5SU92v4q6z+6LPpoHOh97ptAVXZYNTtU0LevyvD5lja0TzbvJm6C eFXitJfnm1pLEr0DGJCR/iUOl/N62Kh4855zZC7NHIjQHPOvV5Stz/l5ilDhvGVk+xkXFPys SjZoUr1rXhYLpiyi5sR0X9FHXT0KnGuz1F5ERO7ZTLSSQ6fJwPj6gOk9K+vvoKvoeql5ABEB AAG0L0FuZHJldyBEdW5zdGFuIDxhbmRyZXcuZHVuc3RhbkAybmRRdWFkcmFudC5jb20+iQFY BBMBAgBCAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgBYhBOQ+WEYd/Hy/RGkVpZn6f8tZ /DuBAhkBBQJd1pSYBQkSzqMsAAoJEJn6f8tZ/DuBJmEIAIVFBIC3qGqh+YTPVTkfowwxpHz0 tZSPjZ6GS/5y62kgoZrZOVXw+Rg2ceuMM3a+In/RRjTx4bembgYqRKgzXlDfiNBJeq5ioVuN H1faDKE2lm5a6QkRQ2JU6DKf60fqSJGP5LisCUr1V0wz6EnlO31ArrKtXCNB+yk0KDAS6o6I Ql4pkXpr+vq4iilwJmiJOqTBam0LmQE7ulYCCYU8Z6MkpiSl+dO7QSramcGyxauQRI3a7gcq dpo8Vrv3gFTQDeMYxk7cqZp08pIVH5XR0+LgBz4X84f59rA/VAKlC/r6CyEQk59rvDLxCMyP 2buoj51Z25N3MVghRDGcsU6mT7e5AQ0ETspYWQEIANGc4zQULOxhbqO2dyD51YhqCNRmm9oK Waqf+wmW4tpDe/VVcxAnNizd4LWCHfzpb5cHAtGkOPePMfzWVf6nvdF7d3eglbtf59+zG7O7 llV0xSSoFiieQBsrGvqDInXYX/4mRRXMtyhM353/tixC9RWLs1oofyYmCPPXXY7h9R7en3B8 BoVrRFcdzlIY/NFNhFGW/9dkEiGjgna2Rk6e15kln4ZvFBWUg23p93w/pqXcxY6+k/8TEk+C 4R+M6w7o2PLGOjdZ+kPiUcw5H85zf/yZJwQXzisXaNduwWB6Vads9YC9dj6kPR1c4VGRqAaY L++LAEOqrlvm2TvqQqZRtnEAEQEAAYkBJQQYAQIADwIbDAUCXdaUtAUJEs6jVQAKCRCZ+n/L Wfw7gQi5B/9sHbmRloZNCWWwZGm+O9iG/JGQxS0WWa4GaZqzqSTWOft2/gO0Bgag89r1djq4 PFgSZtzHvKQpqYz/7HkPrWh1jpcS83i/uYY1uyHXUUtpdEmn4buNObEtD0YNaJkGdhASsECq 6akw+u7WJYmAHs/SpR6ok6HqLw7JHDVc2h5dViLfTk0qrgDa7sq/LVMoJje5Ct/Ku3YaWAV6 YSmzoPP5BmPVFqP11OMQkCqurIu9vTLXKFWX623vCmqRDHJ6e5GCDHbH8USU+4wJBfPymZkd cA7NGm/mmWeJiWBFIDyjzYxrjku8ty9TZJVsaRXnS+OFQzXz9Eu2wTpKdHij46uY Message-ID: Date: Mon, 3 Aug 2020 15:18:47 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------3DFB49704F3C69CCA14E8F58" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------3DFB49704F3C69CCA14E8F58 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 8/3/20 12:46 PM, Andrew Dunstan wrote: > On 7/31/20 4:44 PM, Andrew Dunstan wrote: >> On 7/15/20 6:18 PM, Daniel Gustafsson wrote: >>>> On 15 Jul 2020, at 20:35, Andrew Dunstan wrote: >>>> >>>> On 5/15/20 4:46 PM, Daniel Gustafsson wrote: >>>>> My plan is to keep hacking at this to have it reviewable for the 14 cycle, so >>>>> if anyone has an interest in NSS, then I would love to hear feedback on how it >>>>> works (and doesn't work). >>>> I'll be happy to help, particularly with Windows support and with some >>>> of the callback stuff I've had a hand in. >>> That would be fantastic, thanks! The password callback handling is still a >>> TODO so feel free to take a stab at that since you have a lot of context on >>> there. >>> >>> For Windows, I've include USE_NSS in Solution.pm as Thomas pointed out in this >>> thread, but that was done blind as I've done no testing on Windows yet. >>> >> OK, here is an update of your patch that compiles and runs against NSS >> under Windows (VS2019). >> >> >> In addition to some work that was missing in src/tools/msvc, I had to >> make a few adjustments, including: >> >> >> * strtok_r() isn't available on Windows. We don't use it elsewhere in >> the postgres code, and it seemed unnecessary to have reentrant calls >> here, so I just replaced it with equivalent strtok() calls. >> * We were missing an NSS implementation of >> pgtls_verify_peer_name_matches_certificate_guts(). I supplied a >> dummy that's enough to get it building cleanly, but that needs to be >> filled in properly. >> >> >> There is still plenty of work to go, but this seemed a sufficient >> milestone to report progress on. >> >> > > OK, this version contains pre-generated nss files, and passes a full > buildfarm run including the ssl test module, with both openssl and NSS. > That should keep the cfbot happy :-) > > rebased on current master. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --------------3DFB49704F3C69CCA14E8F58 Content-Type: text/x-patch; charset=UTF-8; name="0001-WIP-Support-libnss-for-as-TLS-backend-v8.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-WIP-Support-libnss-for-as-TLS-backend-v8.patch"