Implemented URI mapping for local file signature#16
Open
Qubitza wants to merge 7 commits intovoipir:masterfrom
Open
Implemented URI mapping for local file signature#16Qubitza wants to merge 7 commits intovoipir:masterfrom
Qubitza wants to merge 7 commits intovoipir:masterfrom
Conversation
Qubitza
commented
Aug 20, 2025
| EcdsaSha384, | ||
| EcdsaSha512, | ||
| HmacMd5, | ||
| // HmacMd5, |
Author
There was a problem hiding this comment.
I had to disable MD5 as it was not included in my openssl version.
Feel free to add it back in, if you think MD5 is still a thing.
Qubitza
commented
Aug 20, 2025
Comment on lines
+252
to
+259
| if bindings::xmlSecIORegisterCallbacks( | ||
| Some(io_match_callback), | ||
| Some(io_open_callback), | ||
| Some(io_read_callback), | ||
| Some(io_close_callback), | ||
| ) < 0 { | ||
| panic!("Failed to register IO callbacks"); | ||
| } |
Author
There was a problem hiding this comment.
This is the part where the callbacks are set which allow to resolve URI by our own code.
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.
As proposed in #15 I introduced the feature to define a URI mapping for local file signatures.
You can either set the actual local file path for a URI or directly pass the content for a defined URI
The biggest pain point was the fact that the callback functions from xmlsec1 don't provide the context.
This would have allowed to put the mapping into the user_data field.
To solve this challenge, the mapping is written into (and removed afterward) a thread-static variable when sign or validate is invoked.
As I'm not a rust expert feel free to provide improvements.