-
Notifications
You must be signed in to change notification settings - Fork 908
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
auth_ephemeral: fix authentication with secrets added at runtime #3390
Conversation
- proper way to work with shm pointer to secret list
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.
Thanks for the PR. I just added one remark related to the freeing of the previous allocated memory in an error condition. Maybe others like to comment as well, as I do not use this module a lot.
if (secret_list == NULL) | ||
{ | ||
LM_ERR("unable to allocate shared memory\n"); | ||
return -1; |
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.
You probably want to free the previously allocated secret_struct
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.
Hi, Henning!
You're right, i missed this, will fix.
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.
Fixed.
Free shm secret_struct in case the allocation error of secret_list pointer.
Thanks! |
* auth_ephemeral: fix authentication with secrets added at runtime - proper way to work with shm pointer to secret list * fix: free secret_struct shm Free shm secret_struct in case the allocation error of secret_list pointer. (cherry picked from commit 6fa5a8f)
Pre-Submission Checklist
in
doc/
subfolder, the README file is autogenerated)Type Of Change
Checklist:
Description
In case of adding secrets at runtime with autheph.add_secret rpc, authentication with new secrets not work,
this is because rpc process modify local pointer to secret list, instead shm.