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

Method ReadHeaderOpenSSL

extra/yassl/taocrypt/src/asn.cpp:394–434  ·  view source on GitHub ↗

Read OpenSSL format public header

Source from the content-addressed store, hash-verified

392
393// Read OpenSSL format public header
394void RSA_Public_Decoder::ReadHeaderOpenSSL()
395{
396 byte b = source_.next(); // peek
397 source_.prev();
398
399 if (b != INTEGER) { // have OpenSSL public format
400 GetSequence();
401 b = source_.next();
402 if (b != OBJECT_IDENTIFIER) {
403 source_.SetError(OBJECT_ID_E);
404 return;
405 }
406
407 word32 len = GetLength(source_);
408 source_.advance(len);
409
410 b = source_.next();
411 if (b == TAG_NULL) { // could have NULL tag and 0 terminator, may not
412 b = source_.next();
413 if (b != 0) {
414 source_.SetError(EXPECT_0_E);
415 return;
416 }
417 }
418 else
419 source_.prev(); // put back
420
421 b = source_.next();
422 if (b != BIT_STRING) {
423 source_.SetError(BIT_STR_E);
424 return;
425 }
426
427 len = GetLength(source_);
428 b = source_.next();
429 if (b != 0) // could have 0
430 source_.prev(); // put back
431
432 GetSequence();
433 }
434}
435
436
437void RSA_Public_Decoder::ReadHeader()

Callers

nothing calls this directly

Calls 5

GetLengthFunction · 0.85
advanceMethod · 0.80
nextMethod · 0.45
prevMethod · 0.45
SetErrorMethod · 0.45

Tested by

no test coverage detected