From patchwork Fri Dec 22 06:03:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 10128829 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1FCA06056E for ; Fri, 22 Dec 2017 06:03:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11E0F298AA for ; Fri, 22 Dec 2017 06:03:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0706029BDD; Fri, 22 Dec 2017 06:03:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BF3D29909 for ; Fri, 22 Dec 2017 06:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753002AbdLVGDg (ORCPT ); Fri, 22 Dec 2017 01:03:36 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:38697 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751912AbdLVGDP (ORCPT ); Fri, 22 Dec 2017 01:03:15 -0500 Received: from mail-it0-f69.google.com ([209.85.214.69]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1eSGQM-0002eY-En for linux-wireless@vger.kernel.org; Fri, 22 Dec 2017 06:03:14 +0000 Received: by mail-it0-f69.google.com with SMTP id p144so9668079itc.9 for ; Thu, 21 Dec 2017 22:03:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=W6jegVFZ4/4CuFiPcb7WpF3GwJ1N7sL3f2FAvHI1+q4=; b=YXBhkyONunB+8OOOTe+cJhHsDKkVIF5YcYWLqnnvI0TIAWpC4to4AmrNe8gkogR97L RunxO7OkqaKyskO0neEWFrX3KoCtETWrfjmeTzs6uH5pvS7xZoticgE9Fhk4rVGXJ6Bv C5eO9w7h4HBLJy6k0Szig82q3iFA6L1wGPt7GMyLrWvvl5CMv7EzrDx0OU0h6VPWefTF H6d4h4m/+mZbZypYfhwF5eWrthg7OVD24ZiGbNpP5CgbbHjGP8j/wxA2gWU1v70MDb8t H8zYdNisAUXPy8xlbZllTkDUcju0p7W4c8y0yLAXc9ISWkED81bzE1ESOlWiUpXR/2eu ldQw== X-Gm-Message-State: AKGB3mItWjajsPTlPnJWwIASqdrxb+pb5kk8+IyFrTDuJ+kD+Ml34OQ3 K6NvIlh+SXzfwul7bMpuY0P3tj/b0UsfML+GtFZLUPDnHBTSGz0F1DluzmSH9Q7WhUOcT5eZaUe 1zbrxSgrfBNAt0mAPw2lfDG4bNHXAgV740k5m17RCG/lF X-Received: by 10.36.92.14 with SMTP id q14mr15963685itb.79.1513922592987; Thu, 21 Dec 2017 22:03:12 -0800 (PST) X-Google-Smtp-Source: ACJfBoursrKun2ypm1uDcNl4LETgMx836sF5tnTWOcYlAc5p9ggC6X+enz64KzbBRmRdJsWU11qCmQ== X-Received: by 10.36.92.14 with SMTP id q14mr15963659itb.79.1513922592727; Thu, 21 Dec 2017 22:03:12 -0800 (PST) Received: from localhost ([2605:a601:aae:1b20:ed05:64dd:188e:d39c]) by smtp.gmail.com with ESMTPSA id q3sm1279818ioh.40.2017.12.21.22.03.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Dec 2017 22:03:12 -0800 (PST) From: Seth Forshee To: linux-wireless@vger.kernel.org, wireless-regdb@lists.infradead.org Cc: Johannes Berg Subject: [PATCH 4/6] wireless-regdb: Better support for generating public certificates Date: Fri, 22 Dec 2017 00:03:01 -0600 Message-Id: <20171222060303.14478-5-seth.forshee@canonical.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171222060303.14478-1-seth.forshee@canonical.com> References: <20171222060303.14478-1-seth.forshee@canonical.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current makefile rule for the public certificate calls for an openssl config file which is not provided. Let's put the pubcert generation into a script named gen-pubcert.sh and embed the openssl configuration file there. Signed-off-by: Seth Forshee --- Makefile | 4 +--- gen-pubcert.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100755 gen-pubcert.sh diff --git a/Makefile b/Makefile index 9532c29a1dc2..044251f64785 100644 --- a/Makefile +++ b/Makefile @@ -79,9 +79,7 @@ $(REGDB_PUBKEY): $(REGDB_PRIVKEY) $(REGDB_PUBCERT): $(REGDB_PRIVKEY) @echo "Generating certificate for $(REGDB_AUTHOR)..." - @openssl req -config regulatory.openssl.conf \ - -key $(REGDB_PRIVKEY) -days 36500 -utf8 -nodes -batch \ - -x509 -outform PEM -out $(REGDB_PUBCERT) + ./gen-pubcert.sh $(REGDB_PRIVKEY) $(REGDB_PUBCERT) @echo $(REGDB_PUBKEY) > .custom diff --git a/gen-pubcert.sh b/gen-pubcert.sh new file mode 100755 index 000000000000..1a4d57999e5d --- /dev/null +++ b/gen-pubcert.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [[ $# -ne 2 ]]; then + echo "Usage: $0 priv-key out-file" + exit 1 +fi + +openssl req -new -key "$1" -days 36500 -utf8 -nodes -batch \ + -x509 -outform PEM -out "$2" \ + -config <(cat <<-EOF + [ req ] + distinguished_name = req_distinguished_name + string_mask = utf8only + prompt = no + [ req_distinguished_name ] + commonName = sforshee + EOF + )