MCPcopy Create free account
hub / github.com/LUX-Core/lux / BERDecodeTextString

Function BERDecodeTextString

src/cryptopp/asn.cpp:159–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159size_t BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte asnTag)
160{
161 byte b;
162 if (!bt.Get(b) || b != asnTag)
163 BERDecodeError();
164
165 size_t bc;
166 if (!BERLengthDecode(bt, bc))
167 BERDecodeError();
168 if (bc > bt.MaxRetrievable()) // Issue 346
169 BERDecodeError();
170
171 SecByteBlock temp(bc);
172 if (bc != bt.Get(temp, bc))
173 BERDecodeError();
174 str.assign((char *)temp.begin(), bc);
175 return bc;
176}
177
178/// ASN BitString
179size_t DEREncodeBitString(BufferedTransformation &bt, const byte *str, size_t strLen, unsigned int unusedBits)

Callers 1

RunASN1TestSetFunction · 0.85

Calls 6

BERDecodeErrorFunction · 0.85
BERLengthDecodeFunction · 0.85
GetMethod · 0.45
MaxRetrievableMethod · 0.45
assignMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected