| 115 | } |
| 116 | |
| 117 | size_t BERDecodeOctetString(BufferedTransformation &bt, SecByteBlock &str) |
| 118 | { |
| 119 | byte b; |
| 120 | if (!bt.Get(b) || b != OCTET_STRING) |
| 121 | BERDecodeError(); |
| 122 | |
| 123 | size_t bc; |
| 124 | if (!BERLengthDecode(bt, bc)) |
| 125 | BERDecodeError(); |
| 126 | if (bc > bt.MaxRetrievable()) // Issue 346 |
| 127 | BERDecodeError(); |
| 128 | |
| 129 | str.New(bc); |
| 130 | if (bc != bt.Get(str, bc)) |
| 131 | BERDecodeError(); |
| 132 | return bc; |
| 133 | } |
| 134 | |
| 135 | size_t BERDecodeOctetString(BufferedTransformation &bt, BufferedTransformation &str) |
| 136 | { |
no test coverage detected