fix some errors in the previous refactor
Change-Id: I6fced76ee754d93aa571313b81f3704dd50f1f35
diff --git a/src/ca-module.cpp b/src/ca-module.cpp
index d829f63..8b1c72a 100644
--- a/src/ca-module.cpp
+++ b/src/ca-module.cpp
@@ -267,7 +267,13 @@
shared_ptr<security::v2::Certificate> clientCert = nullptr;
// parse certificate request
- Block requestPayload = parameterTLV.get(tlv_cert_request);
+ Block requestPayload;
+ if (requestType == RequestType::NEW) {
+ requestPayload = parameterTLV.get(tlv_cert_request);
+ }
+ else if (requestType == RequestType::REVOKE) {
+ requestPayload = parameterTLV.get(tlv_cert_to_revoke);
+ }
requestPayload.parse();
try {
security::v2::Certificate cert = security::v2::Certificate(requestPayload.get(tlv::Data));