GSSContext context( (gss_ctx_id_t)rand(), true );
std::string key = GSSContextCache::instance()->store(context);
- std::string input = "{\"method\": \"gss_pseudo_random\", \
- \"arguments\": \
- { \
+ std::string input = "{ \
\"context_handle\": \"" + key + "\", \
\"prf_key\": 1234567890, \
\"prf_in\": \"mary had a little lamb\", \
\"desired_output_len\": 256 \
- }\
- }";
+ }";
json_error_t jsonErr;
JSONObject json = JSONObject::load(input.c_str(), 0, &jsonErr);
// std::cout << "\nGSSWrap JSON: \n" << result->dump() << "\n";
CPPUNIT_ASSERT_EQUAL_MESSAGE(
- "The command name is incorrect",
- std::string("gss_pseudo_random"),
- std::string( (*result)["command"].string() )
- );
-
- CPPUNIT_ASSERT_EQUAL_MESSAGE(
"The return value was reported incorrectly",
(int)MockPseudoRandom::retVal,
- (int)( (*result)["return_values"]["major_status"].integer() )
+ (int)( (*result)["major_status"].integer() )
);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"The minor_status value was reported incorrectly",
(int)MockPseudoRandom::minor_status,
- (int)( (*result)["return_values"]["minor_status"].integer() )
+ (int)( (*result)["minor_status"].integer() )
);
CPPUNIT_ASSERT_EQUAL_MESSAGE(
"The random bytes were reported incorrectly",
MockPseudoRandom::outputMessageBuffer.toString(),
- std::string( (*result)["return_values"]["random_bytes"].string() )
+ std::string( (*result)["random_bytes"].string() )
);