From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by mx.groups.io with SMTP id smtpd.web10.2278.1594320442596718704 for ; Thu, 09 Jul 2020 11:47:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Zx3NqMvR; spf=pass (domain: gmail.com, ip: 209.85.210.196, mailfrom: matthewfcarlson@gmail.com) Received: by mail-pf1-f196.google.com with SMTP id m9so1404881pfh.0 for ; Thu, 09 Jul 2020 11:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=1t1fDIcVg3tlAqf2x9mMkzMNbUbgSqKYgHxVELGsGoU=; b=Zx3NqMvRmKWuiVPF0t0bp7V63emEeTJWSWGY61aVT7mID+zQKtRILLbLdSRqkmnb5c iYG5isgilxwC9EqkSXomZth6i1tkjDFXEFOKJCnL7AmHDtsHYQXp3An8gR4epvJ8ExS/ 42146p/hCN3QjK8XwtIUD8h6S0+gUOFoYgzZBc+kCpkHmxvZ0/lW+/qyt298LsuIPZgn gq4EizSxzUZI0F4qhHHM3o1O4o6j2R1nqSXqyJUBbscRF/BjEkK/MB4CFWn/+3WKa5QN uwtWwEnojealM/LUtj50rgF0zdqe/J65syHHhlfgGvMY8hN/m1PnRiXa1pCe/BctSaHM rRKQ== 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=1t1fDIcVg3tlAqf2x9mMkzMNbUbgSqKYgHxVELGsGoU=; b=tQTBr6VulsaBJtWUvBnS99xI6p4cRAJzDkTw98amkWtdnTraVVvBkIE2rXLvuJaNiG xXBVOMisTBppE9hW93U/B0/blgyirr7AhpJLVjMD+wR/iRqYmypzJ9GEc8cTGaTCFJrL Zo+xa8103jtgASeGCiqXIqLc3amuAGFKdPc2FMhQPYMtZycc0w8W8zmYiQa0inpFW0R2 nFFgDaRV81mY9Zb9o0C58eQzmrJEC6ShOXmgDS7eCS8mCMyLDDUYlA+IsD4aWmWGjp6Y 6aRelmQDPMcUWkBT5M9VwnoqDYkwB2pi8WVQ74Uy15ryQKkaYdOFcXo0vmq/dJIp3qmR j6kw== X-Gm-Message-State: AOAM533Xm6YJ9dRPy4v2LjmRsILWI9riljjodPKeGDGss4u3DDYFLCP9 V+Sm5CZjhZIskUJLLIBbxMBk6mcWMoA= X-Google-Smtp-Source: ABdhPJwvp9WQh3OXeFWBw+6VoW5ecEp0xQzrD7d4o7jxn8eAe9BJC0F6kIylBSosFfgekIcrdjz0kQ== X-Received: by 2002:a63:80c8:: with SMTP id j191mr52668273pgd.38.1594320441786; Thu, 09 Jul 2020 11:47:21 -0700 (PDT) Return-Path: Received: from tvis-name-05.localdomain ([50.34.40.129]) by smtp.gmail.com with ESMTPSA id b11sm3581140pfr.179.2020.07.09.11.47.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2020 11:47:21 -0700 (PDT) From: matthewfcarlson@gmail.com To: devel@edk2.groups.io Subject: [PATCH v2 0/3] Add Host Based Unit Tests for BaseCryptLib to CryptoPkg Date: Thu, 9 Jul 2020 11:47:17 -0700 Message-Id: <20200709184720.1746-1-matthewfcarlson@gmail.com> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Matthew Carlson This turns on Host Based Unit Tests for CryptoPkg, adds the unit test itself, and adds a POSIX BaseTimerLib for unit tests. Matthew Carlson (3): UnitTestFrameworkPkg : BaseTimerLibPosix: Adds a host-based timer Lib CryptoPkg: BaseCryptLib: Add unit tests (Host and Shell based) AzurePipelines : Pr Gate: Turn on HBUT for CryptoPkg CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c | 93 ++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/AuthenticodeTests.c | 1002 ++++++++++++++++++++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/BaseCryptLibUnitTests.c | 66 ++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/BlockCipherTests.c | 293 ++++++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c | 106 +++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/HashTests.c | 197 ++++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/HmacTests.c | 184 ++++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/OaepEncryptTests.c | 308 ++++++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/Pkcs5Pbkdf2Tests.c | 71 ++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/Pkcs7EkuTests.c | 524 ++++++++++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/RandTests.c | 51 + CryptoPkg/Test/UnitTest/Library/BaseCryptLib/RsaPkcs7Tests.c | 415 ++++++++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/RsaTests.c | 310 ++++++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TSTests.c | 335 +++++++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/UnitTestMain.c | 81 ++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/UnitTestMainBCOP.c | 58 ++ UnitTestFrameworkPkg/Library/Posix/BaseTimerLibPosix/TimerLibPosix.c | 125 +++ .azurepipelines/templates/pr-gate-build-job.yml | 2 +- CryptoPkg/CryptoPkg.ci.yaml | 6 +- CryptoPkg/CryptoPkg.dsc | 26 + CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf | 90 ++ CryptoPkg/Test/UnitTest/CryptoPkgHostUnitTest.dsc | 35 + CryptoPkg/Test/UnitTest/Library/BaseCryptLib/Pkcs7EkuTestSignatures.h | 789 +++++++++++++++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLib.h | 121 +++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibHost.inf | 46 + CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibUefiShell.inf | 49 + CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/ChainCreationInstructions.txt | 92 ++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/CreateTestCerts.cmd | 11 + CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/SignFirmwareWithEKUs.cmd | 76 ++ CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingIssuingCA.ini | 45 + CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingLeafSigner.ini | 25 + CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingLeafSignerPid1.ini | 24 + CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingLeafSignerPid12345.ini | 27 + CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingNoEKUsInSigner.ini | 16 + CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingPolicyCA.ini | 28 + CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingRoot.ini | 28 + UnitTestFrameworkPkg/Library/Posix/BaseTimerLibPosix/BaseTimerLibPosix.inf | 38 + UnitTestFrameworkPkg/Library/Posix/BaseTimerLibPosix/BaseTimerLibPosix.uni | 15 + UnitTestFrameworkPkg/Test/UnitTestFrameworkPkgHostTest.dsc | 1 + UnitTestFrameworkPkg/UnitTestFrameworkPkgHost.dsc.inc | 4 +- 40 files changed, 5808 insertions(+), 5 deletions(-) create mode 100644 CryptoPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/AuthenticodeTests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/BaseCryptLibUnitTests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/BlockCipherTests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/DhTests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/HashTests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/HmacTests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/OaepEncryptTests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/Pkcs5Pbkdf2Tests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/Pkcs7EkuTests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/RandTests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/RsaPkcs7Tests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/RsaTests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TSTests.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/UnitTestMain.c create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/UnitTestMainBCOP.c create mode 100644 UnitTestFrameworkPkg/Library/Posix/BaseTimerLibPosix/TimerLibPosix.c create mode 100644 CryptoPkg/Library/BaseCryptLib/UnitTestHostBaseCryptLib.inf create mode 100644 CryptoPkg/Test/UnitTest/CryptoPkgHostUnitTest.dsc create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/Pkcs7EkuTestSignatures.h create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLib.h create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibHost.inf create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestBaseCryptLibUefiShell.inf create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/ChainCreationInstructions.txt create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/CreateTestCerts.cmd create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/SignFirmwareWithEKUs.cmd create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingIssuingCA.ini create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingLeafSigner.ini create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingLeafSignerPid1.ini create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingLeafSignerPid12345.ini create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingNoEKUsInSigner.ini create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingPolicyCA.ini create mode 100644 CryptoPkg/Test/UnitTest/Library/BaseCryptLib/TestEKUCerts/TestEKUParsingRoot.ini create mode 100644 UnitTestFrameworkPkg/Library/Posix/BaseTimerLibPosix/BaseTimerLibPosix.inf create mode 100644 UnitTestFrameworkPkg/Library/Posix/BaseTimerLibPosix/BaseTimerLibPosix.uni -- 2.27.0.windows.1