Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Sep 20, 2024
1 parent c187579 commit eacf58f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 2 additions & 4 deletions crypto/fipsmodule/cpucap/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,8 @@ OPENSSL_INLINE int CRYPTO_is_VPCLMULQDQ_capable(void) {
// 1100_0000_0010_0011_0000_0000_0000_0000
#define CPU_CAP_AVX512IFMA_BITFLAGS 0xC0230000
OPENSSL_INLINE int CRYPTO_is_AVX512IFMA_capable(void) {
return 0;
// TODO: Re-enable once we understand Windows test failures.
// return (OPENSSL_ia32cap_get()[2] & CPU_CAP_AVX512IFMA_BITFLAGS) ==
// CPU_CAP_AVX512IFMA_BITFLAGS;
return (OPENSSL_ia32cap_get()[2] & CPU_CAP_AVX512IFMA_BITFLAGS) ==
CPU_CAP_AVX512IFMA_BITFLAGS;
}

OPENSSL_INLINE int CRYPTO_is_VBMI2_capable(void) {
Expand Down
10 changes: 6 additions & 4 deletions tool-openssl/x509_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ X509* CreateAndSignX509Certificate() {
}
bssl::UniquePtr<RSA> rsa(RSA_new());
bssl::UniquePtr<BIGNUM> bn(BN_new());
if (!bn || !BN_set_word(bn.get(), RSA_F4) ||
if (!rsa || !bn || !BN_set_word(bn.get(), RSA_F4) ||
!RSA_generate_key_ex(rsa.get(), 2048, bn.get(), nullptr) ||
!EVP_PKEY_assign_RSA(pkey.get(), rsa.release())) {
return nullptr;
Expand Down Expand Up @@ -54,7 +54,9 @@ class X509Test : public ::testing::Test {
bssl::UniquePtr<RSA> rsa(RSA_new());
ASSERT_TRUE(rsa);
bssl::UniquePtr<BIGNUM> bn(BN_new());
ASSERT_TRUE(bn && rsa && BN_set_word(bn.get(), RSA_F4) && RSA_generate_key_ex(rsa.get(), 2048, bn.get(), nullptr));
ASSERT_TRUE(bn);
ASSERT_TRUE(BN_set_word(bn.get(), RSA_F4));
ASSERT_TRUE(RSA_generate_key_ex(rsa.get(), 2048, bn.get(), nullptr));
ASSERT_TRUE(EVP_PKEY_assign_RSA(pkey.get(), rsa.release()));

ScopedFILE signkey_file(fopen(signkey_path, "wb"));
Expand All @@ -70,8 +72,8 @@ class X509Test : public ::testing::Test {

bssl::UniquePtr<X509_REQ> csr(X509_REQ_new());
ASSERT_TRUE(csr);
X509_REQ_set_pubkey(csr.get(), pkey.get());
X509_REQ_sign(csr.get(), pkey.get(), EVP_sha256());
ASSERT_TRUE(X509_REQ_set_pubkey(csr.get(), pkey.get()));
ASSERT_GT(X509_REQ_sign(csr.get(), pkey.get(), EVP_sha256()), 0);

ScopedFILE csr_file(fopen(csr_path, "wb"));
ASSERT_TRUE(csr_file);
Expand Down

0 comments on commit eacf58f

Please sign in to comment.