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

Method GetSignature

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

read cert signature, store in signature_

Source from the content-addressed store, hash-verified

675
676// read cert signature, store in signature_
677word32 CertDecoder::GetSignature()
678{
679 if (source_.GetError().What()) return 0;
680 byte b = source_.next();
681
682 if (b != BIT_STRING) {
683 source_.SetError(BIT_STR_E);
684 return 0;
685 }
686
687 sigLength_ = GetLength(source_);
688 if (sigLength_ <= 1 || source_.IsLeft(sigLength_) == false) {
689 source_.SetError(CONTENT_E);
690 return 0;
691 }
692
693 b = source_.next();
694 if (b != 0) {
695 source_.SetError(EXPECT_0_E);
696 return 0;
697 }
698 sigLength_--;
699
700 signature_ = NEW_TC byte[sigLength_];
701 memcpy(signature_, source_.get_current(), sigLength_);
702 source_.advance(sigLength_);
703
704 return sigLength_;
705}
706
707
708// read cert digest, store in signature_

Callers

nothing calls this directly

Calls 8

GetLengthFunction · 0.85
IsLeftMethod · 0.80
advanceMethod · 0.80
WhatMethod · 0.45
GetErrorMethod · 0.45
nextMethod · 0.45
SetErrorMethod · 0.45
get_currentMethod · 0.45

Tested by

no test coverage detected