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

Method BERDecode

src/cryptopp/asn.cpp:268–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268void OID::BERDecode(BufferedTransformation &bt)
269{
270 byte b;
271 if (!bt.Get(b) || b != OBJECT_IDENTIFIER)
272 BERDecodeError();
273
274 size_t length;
275 if (!BERLengthDecode(bt, length) || length < 1)
276 BERDecodeError();
277
278 if (!bt.Get(b))
279 BERDecodeError();
280
281 length--;
282 m_values.resize(2);
283 m_values[0] = b / 40;
284 m_values[1] = b % 40;
285
286 while (length > 0)
287 {
288 word32 v;
289 size_t valueLen = DecodeValue(bt, v);
290 if (valueLen > length)
291 BERDecodeError();
292 m_values.push_back(v);
293 length -= valueLen;
294 }
295}
296
297void OID::BERDecodeAndCheck(BufferedTransformation &bt) const
298{

Callers

nothing calls this directly

Calls 12

BERDecodeErrorFunction · 0.85
BERLengthDecodeFunction · 0.85
DecodeValueFunction · 0.85
GetAlgorithmIDFunction · 0.85
BERDecodeAndCheckMethod · 0.80
EndReachedMethod · 0.80
MessageEndMethod · 0.80
CheckByteMethod · 0.80
GetMethod · 0.45
resizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected