-
Notifications
You must be signed in to change notification settings - Fork 484
Fix SSH API #500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SSH API #500
Conversation
|
I am for |
currently writing the documentation on it, should be ready by tonight |
|
Short question, while using the API I thought it'd be useful if the signature of the decoding had a pointer of the length as argument, so we could return the processed length. What do you think? Yes, this would differ from the way its inspiration (DER multi) works, but it already differs by the order by which the arguments get passed... |
|
Following our DER multi pattern is not a good idea, couple of times I was missing the information about the length of actually decoded data. It is IMO necessary to somehow return how much input data was "consumed" during decoding - either by |
|
This would be the behavior I thought about... okay? |
|
Well, I would slightly prefer reverse logic: "Actual length of in buffer used for decoding the given sequence" but yours: "Remaining bytes after decoding the given sequence" will work as well. |
I thought from a usability context if we'd reverse the logic one has to do whereas with my proposal one could do |
|
We already have: /**
ASN.1 DER Flexi(ble) decoder will decode arbitrary DER packets and create a linked list of the decoded elements.
@param in The input buffer
@param inlen [in/out] The length of the input buffer and on output the amount of decoded data
@param out [out] A pointer to the linked list
@return CRYPT_OK on success.
*/
int der_decode_sequence_flexi(const unsigned char *in, unsigned long *inlen, ltc_asn1_list **out) |
|
I went with the old way, because I realized that to do what I wanted, it'd have required too many (paradigm) changes. |
50e05ff to
4b476ed
Compare
|
Does someone have a reason why we shouldn't use |
okay, one step back, let's just stay with |
|
ad |
If there's an EOL at the end of the enum I'm tempted to add new entries before that one and then this will break the ABI which I don't like.
While playing around with the SSH API I realized that as it is now it is incomplete resp. broken.
When reading the RFC4251 Ch. 5 it says
which is clearly not possible as it is implemented now.
I think there are two ways this could be handled in the order of preference
LTC_SSHDATA_STRINGas proposed in the API description of the two c filesLTC_SSHDATA_BUFFERas proposed in the header fileThe disadvantage of 1. would be that it would break existing applications, but I think we can live with that for the sake of a better API.
Your thoughts?
CC @rmw42 @mkj