From patchwork Wed Jul 15 20:37:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mimi Zohar X-Patchwork-Id: 11666199 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 20D7B13A4 for ; Wed, 15 Jul 2020 20:37:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 140CE206F4 for ; Wed, 15 Jul 2020 20:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726650AbgGOUhc (ORCPT ); Wed, 15 Jul 2020 16:37:32 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:4762 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726742AbgGOUhc (ORCPT ); Wed, 15 Jul 2020 16:37:32 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06FKWH78146959; Wed, 15 Jul 2020 16:37:29 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 329d9jhv1h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Jul 2020 16:37:29 -0400 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06FKXcYJ150866; Wed, 15 Jul 2020 16:37:29 -0400 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com with ESMTP id 329d9jhv0w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Jul 2020 16:37:29 -0400 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06FKVY2l005666; Wed, 15 Jul 2020 20:37:27 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma02fra.de.ibm.com with ESMTP id 327527vycc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Jul 2020 20:37:27 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06FKbPw464159946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Jul 2020 20:37:25 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 21DC8A4053; Wed, 15 Jul 2020 20:37:25 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E8F4A404D; Wed, 15 Jul 2020 20:37:24 +0000 (GMT) Received: from localhost.localdomain (unknown [9.85.155.184]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 15 Jul 2020 20:37:24 +0000 (GMT) From: Mimi Zohar To: linux-integrity@vger.kernel.org Cc: Mimi Zohar , Petr Vorel , Bruno Meneguele Subject: [PATCH 2/3] ima-evm-utils: reading public keys Date: Wed, 15 Jul 2020 16:37:14 -0400 Message-Id: <1594845435-19164-2-git-send-email-zohar@linux.ibm.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1594845435-19164-1-git-send-email-zohar@linux.ibm.com> References: <1594845435-19164-1-git-send-email-zohar@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-15_12:2020-07-15,2020-07-15 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=999 suspectscore=1 malwarescore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 spamscore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007150154 Sender: linux-integrity-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-integrity@vger.kernel.org Not being able to read the public key is not necessarily an error. Emit a message based on log level. Signed-off-by: Mimi Zohar --- src/libimaevm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libimaevm.c b/src/libimaevm.c index b8d576969aa4..16e07e82b9e3 100644 --- a/src/libimaevm.c +++ b/src/libimaevm.c @@ -323,7 +323,8 @@ EVP_PKEY *read_pub_pkey(const char *keyfile, int x509) fp = fopen(keyfile, "r"); if (!fp) { - log_err("Failed to open keyfile: %s\n", keyfile); + if (imaevm_params.verbose > LOG_INFO) + log_info("Failed to open keyfile: %s\n", keyfile); return NULL; }