Validate Integrity Algorithm in Open Session Request command
Change-Id: I54106099fbbe50156529644eaadd65dc1db7e141
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/command/open_session.cpp b/command/open_session.cpp
index 5b0800f..96507f6 100644
--- a/command/open_session.cpp
+++ b/command/open_session.cpp
@@ -28,10 +28,8 @@
}
// Check for valid Integrity Algorithms
- if ((request->intAlgo !=
- static_cast<uint8_t>(cipher::integrity::Algorithms::NONE)) &&
- (request->intAlgo !=
- static_cast<uint8_t>(cipher::integrity::Algorithms::HMAC_SHA1_96)))
+ if(!cipher::integrity::Interface::isAlgorithmSupported(static_cast
+ <cipher::integrity::Algorithms>(request->intAlgo)))
{
response->status_code =
static_cast<uint8_t>(RAKP_ReturnCode::INVALID_INTEGRITY_ALGO);