credssp: improve ber parsing/peeking and add support for new messages#121
Open
credssp: improve ber parsing/peeking and add support for new messages#121
Conversation
Comment on lines
+150
to
+152
| this->User.assign(user_utf16_av.data(), user_utf16_av.data()+user_utf16_av.size()); | ||
| this->Domain.assign(domain_utf16_av.data(), domain_utf16_av.data()+domain_utf16_av.size()); | ||
| this->Password.assign(password_utf16_av.data(), password_utf16_av.data()+password_utf16_av.size()); |
Contributor
There was a problem hiding this comment.
This can be simplified with
this->User.assign(user_utf16_av.begin(), user_utf16_av.end());| inline std::vector<uint8_t> mkOid(bytes_view oid) | ||
| { | ||
| std::vector<uint8_t> ret = mkOidHeader(oid.size()); | ||
| ret << std::vector<uint8_t>(oid.data(), oid.data()+oid.size()); |
Contributor
There was a problem hiding this comment.
<< should take a bytes_view/array_view. I also think <<= to be more explicit than <<.
But is it really better than insert() ?
ret.insert(ret.end(), oid.begin(), oid.end());| backward_push_tagged_field_header(head, oid.size() + head.size(), tag); | ||
| std::reverse(head.begin(), head.end()); | ||
|
|
||
| head << std::vector<uint8_t>(oid.begin(), oid.end()); |
Comment on lines
+333
to
+334
| if (verbose) | ||
| LOG(LOG_ERR, "%s: Ber parse error", message); |
Contributor
There was a problem hiding this comment.
There is a macro LOG_IF(verbose, ....)
Comment on lines
+344
to
+345
| if (verbose) | ||
| LOG(LOG_ERR, "%s: not enough byte for length on 2 bytes", message); |
Comment on lines
+353
to
+354
| if (verbose) | ||
| LOG(LOG_ERR, "%s: not enough byte for length on 3 bytes", message); |
Comment on lines
+361
to
+362
| if (verbose) | ||
| LOG(LOG_ERR, "%s: Ber parse error, length=0x%lx", message, length); |
Comment on lines
+368
to
+370
| if (verbose) | ||
| LOG(LOG_ERR, "%s: Ber Not enough data for length on %lu bytes(need=%lu have=%lu)", | ||
| message, extraSize, extraSize + length, s.size()); |
Comment on lines
+417
to
+418
| if (verbose) | ||
| LOG(LOG_ERR, "%s: Ber unexpected tag", message); |
Comment on lines
+564
to
+565
| BerOID ret = s.in_skip_bytes(bytes).as<std::vector<uint8_t>>(); | ||
| return ret; |
Contributor
There was a problem hiding this comment.
return s.in_skip_bytes(bytes).as<BerOID>();
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.