Skip to content
Snippets Groups Projects
Commit ad8076ff authored by Guillaume Roguez's avatar Guillaume Roguez Committed by gerrit2
Browse files

sdes: fix SdesNegotiator::negotiate()

SdesNegotiator::negotiate() does an invalid check on given offered crypto-suite.
The current setup is made in a way that this function always returns
the remote crypto suite, supported or not! Dangerous.

This patch fixes that by correctly comparing crypto-suite names.

Change-Id: I0ef022486e00b5fef91d2552b83d57463282a683
Tuleap: #747
parent 6545b2ce
No related branches found
No related tags found
No related merge requests found
......@@ -166,7 +166,7 @@ SdesNegotiator::negotiate(const std::vector<std::string>& attributes) const
auto cryptoAttributeVector(parse(attributes));
for (const auto& iter_offer : cryptoAttributeVector) {
for (const auto& iter_local : localCapabilities_) {
if (iter_offer.getCryptoSuite().compare(iter_local.name))
if (iter_offer.getCryptoSuite() == iter_local.name)
return iter_offer;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment