-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hybrid groups to OpenSSLFactory gated behind FIZZ_HAVE_OQS macro
Summary: Add hybrid groups in `HybridKeyExFactory` to OpenSSLFactory, behind a new FIZZ_HAVE_OQS macro. `HybridKeyExFactory` will be removed later. Reviewed By: mingtaoy Differential Revision: D55656400 fbshipit-source-id: 78edb42d8c78d23d18840731a86d1af85d2764c8
- Loading branch information
1 parent
551ade1
commit 3b579d4
Showing
2 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright (c) 2018-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include <fizz/protocol/OpenSSLFactory.h> | ||
#include <fizz/test/HandshakeTest.h> | ||
|
||
namespace fizz { | ||
namespace test { | ||
|
||
class OpenSSLFactoryHandshakeTest : public HandshakeTest, | ||
public WithParamInterface<NamedGroup> {}; | ||
|
||
TEST_P(OpenSSLFactoryHandshakeTest, openssl_factory_handshake_test) { | ||
auto namedGroup = GetParam(); | ||
auto factory = std::make_shared<OpenSSLFactory>(); | ||
clientContext_->setFactory(factory); | ||
serverContext_->setFactory(factory); | ||
clientContext_->setSupportedGroups({namedGroup}); | ||
clientContext_->setDefaultShares({namedGroup}); | ||
serverContext_->setSupportedGroups({namedGroup}); | ||
expected_.group = namedGroup; | ||
|
||
expectSuccess(); | ||
doHandshake(); | ||
verifyParameters(); | ||
sendAppData(); | ||
} | ||
|
||
INSTANTIATE_TEST_SUITE_P( | ||
OpenSSLFactoryHandshakeTests, | ||
OpenSSLFactoryHandshakeTest, | ||
Values( | ||
NamedGroup::secp256r1, | ||
NamedGroup::secp384r1, | ||
NamedGroup::secp521r1, | ||
NamedGroup::x25519 | ||
#if FIZZ_HAVE_OQS | ||
, | ||
NamedGroup::x25519_kyber512, | ||
NamedGroup::secp256r1_kyber512, | ||
NamedGroup::kyber512, | ||
NamedGroup::x25519_kyber768_draft00, | ||
NamedGroup::x25519_kyber768_experimental, | ||
NamedGroup::secp256r1_kyber768_draft00, | ||
NamedGroup::secp384r1_kyber768 | ||
#endif | ||
), | ||
[](const testing::TestParamInfo<OpenSSLFactoryHandshakeTest::ParamType>& | ||
info) { return toString(info.param); }); | ||
|
||
} // namespace test | ||
} // namespace fizz |