MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / decrypt_message

Function decrypt_message

extra/yassl/src/handshake.cpp:252–269  ·  view source on GitHub ↗

decrypt input message in place, store size in case needed later

Source from the content-addressed store, hash-verified

250
251// decrypt input message in place, store size in case needed later
252void decrypt_message(SSL& ssl, input_buffer& input, uint sz)
253{
254 input_buffer plain(sz);
255 opaque* cipher = input.get_buffer() + input.get_current();
256
257 if (sanity_check_message(ssl, sz) != 0) {
258 ssl.SetError(sanityCipher_error);
259 return;
260 }
261
262 ssl.useCrypto().use_cipher().decrypt(plain.get_buffer(), cipher, sz);
263 memcpy(cipher, plain.get_buffer(), sz);
264 ssl.useSecurity().use_parms().encrypt_size_ = sz;
265
266 if (ssl.isTLSv1_1()) // IV
267 input.set_current(input.get_current() +
268 ssl.getCrypto().get_cipher().get_blockSize());
269}
270
271
272// output operator for input_buffer

Callers 1

DoProcessReplyFunction · 0.85

Calls 8

sanity_check_messageFunction · 0.85
isTLSv1_1Method · 0.80
set_currentMethod · 0.80
get_bufferMethod · 0.45
get_currentMethod · 0.45
SetErrorMethod · 0.45
decryptMethod · 0.45
get_blockSizeMethod · 0.45

Tested by

no test coverage detected