-
Notifications
You must be signed in to change notification settings - Fork 18
Implemented URI mapping for local file signature #16
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
base: master
Are you sure you want to change the base?
Conversation
| EcdsaSha384, | ||
| EcdsaSha512, | ||
| HmacMd5, | ||
| // HmacMd5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the part where the callbacks are set which allow to resolve URI by our own code.
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.