From patchwork Thu Apr 6 04:48:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1765848 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=HH1Mslms; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PsTY82LT0z1yYs for ; Thu, 6 Apr 2023 14:48:59 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1pkHYL-0008QJ-Ve; Thu, 06 Apr 2023 04:48:53 +0000 Received: from smtp-relay-canonical-0.internal ([10.131.114.83] helo=smtp-relay-canonical-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1pkHYK-0008QC-5B for fwts-devel@lists.ubuntu.com; Thu, 06 Apr 2023 04:48:52 +0000 Received: from canonical.com (unknown [106.104.136.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 5F66F3F757 for ; Thu, 6 Apr 2023 04:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1680756531; bh=9uPkoH/RVLcdKwNGB5TdwPMRJbIma2EGd6RBXu8zSB4=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=HH1MslmsqtXzr9VcX6HkrkTjtiGSzLym23uiIRka3d7LP8zanoxqqi82nW88RHXW0 ba8BI2m02T+wFfwSpaCl8rg7nGwSnSiSOEnht7ev8K9O4Lc+yJeyjm47W2hvtvYWob BAX7zSbUVzD6cP4nvaDqjDATKfpLdPdcsEmolFQrSTQ5uUCXqZpxys934uDfScMVAD FaMt76E5lVOF2m0AfUcLQU/LmvW3XVj14/L/AwL+OVyz5cKCLtWA8kM0vuPqDaLpj9 sbx8p58Mplrg/n6N+X3XieznfytRe8DCqxG0x1GR71gstLyeNrAVuefGcOVrlVGE+d WXmeySrD5QWEw== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH] dmicheck: add more checks for invalid serial number string Date: Thu, 6 Apr 2023 12:48:42 +0800 Message-Id: <20230406044842.33237-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Signed-off-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index a6f19932..7e6f0ec4 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -117,6 +117,10 @@ static const fwts_dmi_pattern dmi_patterns[] = { { "DMISerialNumber", "Serial Number", "01234567890" }, { "DMISerialNumber", "Serial Number", "012345678900" }, { "DMISerialNumber", "Serial Number", "0123456789000" }, + { "DMISerialNumber", "Serial Number", "1234567" }, + { "DMISerialNumber", "Serial Number", "12345678" }, + { "DMISerialNumber", "Serial Number", "123456789" }, + { "DMISerialNumber", "Serial Number", "1234567890" }, { "DMISerialNumber", "Serial Number", "System Serial Number" }, { "DMISerialNumber", "Serial Number", "MB-1234567890" }, { "DMISerialNumber", "Serial Number", "NB-1234567890" },