From patchwork Tue Feb 27 22:16:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Hern=C3=A1n_Gonzalez?= X-Patchwork-Id: 10246149 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 233ED602DC for ; Tue, 27 Feb 2018 22:17:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 082F3288B4 for ; Tue, 27 Feb 2018 22:17:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF71928AFB; Tue, 27 Feb 2018 22:17:23 +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,DKIM_SIGNED, DKIM_VALID,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 6D743288B4 for ; Tue, 27 Feb 2018 22:17:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751956AbeB0WRW (ORCPT ); Tue, 27 Feb 2018 17:17:22 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:34911 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751656AbeB0WRV (ORCPT ); Tue, 27 Feb 2018 17:17:21 -0500 Received: by mail-qk0-f194.google.com with SMTP id s188so589672qkb.2 for ; Tue, 27 Feb 2018 14:17:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vanguardiasur-com-ar.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=KPMA9YUQmzhb+057hTy0QkFnqENcvE38R7AfK/qwdpc=; b=tNary6D0IMv1sVdCehtKdzdx1q9FL1CKtS0/OgvBK/P8dRtE2CDEUGYXehN4GeDI9I OMBS3m2u8E0agRByf+f9DxtzuOgLu9XGL/Rt2My5LcZKTpGI8noc0gjJqEBdnoBckU0s 0AeBzy+pzZSyv/QbbKMZ2ecU07r495lZMTW7soCMErxFmB5udDnSHlrw5AHQUDPdrOKz XEV0RJoU6sjp5nfUXeHn91sDvTBr8UA0P5T7ujQpU7CqmDydiHHsIytgS6phAM8kXEIo eCbmFiYzgAKcqDDzNdScUXkX/3xdRrjY9QAIZq/kQg/D55ju4A/mZhPCYgHD0KQj/axn jMtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=KPMA9YUQmzhb+057hTy0QkFnqENcvE38R7AfK/qwdpc=; b=U7m3vQi7ADBa4f11h3Bml0qoqWEM+qQtORNS02eFsrpsJ2qjeClCW/nWcd6oKAPi4b +Z/RFrIYC4yEMkvIKg4KSSdv4yXDDYJjqwm8aB7vj/SkJ6oDxaY7lPkk42sjSf5JjUmh 0AaNgtWLEPRGtZkDLjhCa+7IzAANfE+EE2MY6oELxJo29M4JdtRKQ59wtFSVs/m3uLST A/r924vnjigCSrhOYr2rx5eUjBv/hC2xZmPrMAQZhzZe7HcOIcHTewLUrXQNLCFos1LN zx6qWN5k+UZ1BWrfcSfnXVole4yYxFNbGBOG1Ssc5ZPDjz1uH9nL37RqKwPT4TS7//uW eEAQ== X-Gm-Message-State: APf1xPAlNUDXf4OVNsDBV4uTY/nv7E2wcj1hk2Q1ClxcQ9ZlJlwemwxD TFI8NNXnetyh5y+ojem5up6VAw== X-Google-Smtp-Source: AG47ELtlfcan+QvVSPko9EYEftpYa6zCXLHT0IwHZWBBO7MFRicdV7qmBBw6E1WTf6QTslYEpA1uyg== X-Received: by 10.55.87.134 with SMTP id l128mr23985087qkb.162.1519769841143; Tue, 27 Feb 2018 14:17:21 -0800 (PST) Received: from hlaptop.cpe.express.com.ar ([200.3.222.253]) by smtp.gmail.com with ESMTPSA id j64sm137461qkc.22.2018.02.27.14.17.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Feb 2018 14:17:20 -0800 (PST) From: =?UTF-8?q?Hern=C3=A1n=20Gonzalez?= To: zohar@linux.vnet.ibm.com, jmorris@namei.org, serge@hallyn.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, hernan@vanguardiasur.com.ar Subject: [PATCH 1/2] security: evm: Move evm_hmac and evm_hash from evm_main.c to evm_crypto.c Date: Tue, 27 Feb 2018 19:16:59 -0300 Message-Id: <1519769820-20365-1-git-send-email-hernan@vanguardiasur.com.ar> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Note: This is compile only tested. This variable was not used where it was defined, there was no point in declaring it there as extern, thus it got moved and constified saving up 2 bytes. Function old new delta init_desc 273 271 -2 Total: Before=2112094, After=2112092, chg -0.00% Signed-off-by: HernĂ¡n Gonzalez --- security/integrity/evm/evm.h | 2 -- security/integrity/evm/evm_crypto.c | 3 +++ security/integrity/evm/evm_main.c | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/security/integrity/evm/evm.h b/security/integrity/evm/evm.h index 0482539..45c4a89 100644 --- a/security/integrity/evm/evm.h +++ b/security/integrity/evm/evm.h @@ -31,8 +31,6 @@ EVM_ALLOW_METADATA_WRITES) extern int evm_initialized; -extern char *evm_hmac; -extern char *evm_hash; #define EVM_ATTR_FSUUID 0x0001 diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c index 691f3e0..fdde9cb 100644 --- a/security/integrity/evm/evm_crypto.c +++ b/security/integrity/evm/evm_crypto.c @@ -37,6 +37,9 @@ static DEFINE_MUTEX(mutex); static unsigned long evm_set_key_flags; +char * const evm_hmac = "hmac(sha1)"; +char * const evm_hash = "sha1"; + /** * evm_set_key() - set EVM HMAC key from the kernel * @key: pointer to a buffer with the key data diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c index a8d5028..826926d 100644 --- a/security/integrity/evm/evm_main.c +++ b/security/integrity/evm/evm_main.c @@ -33,8 +33,6 @@ int evm_initialized; static char *integrity_status_msg[] = { "pass", "pass_immutable", "fail", "no_label", "no_xattrs", "unknown" }; -char *evm_hmac = "hmac(sha1)"; -char *evm_hash = "sha1"; int evm_hmac_attrs; char *evm_config_xattrnames[] = {