Skip to content
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 empty authentication info check #37

Closed
lucamrgs opened this issue Mar 11, 2024 · 0 comments · Fixed by #39
Closed

Fix empty authentication info check #37

lucamrgs opened this issue Mar 11, 2024 · 0 comments · Fixed by #39
Milestone

Comments

@lucamrgs
Copy link
Collaborator

Authentication information is an optional property. Currently, no authentication information corresponds to an empty authentication information struct passed to the capability.Execute() function, so it is always passed as either a populated or empty authentication information struct.

Http.utils addAuthTo function checks if authentication information is passed, by checking if it has nil value, or not. If it has nil value, then no auth headers are added, and no further auth info checks are performed.

The bug is in the fact that authentication information will never be "nil", but either a completely empty struct, or a non-completely empty struct. Hence it is always != "nil", and subsequent checks fail.

In this MR, the check is changed to compare the authentication information (passed to Execute for http and OpenC2 capabilities) to an empty struct, instead of to nil value.

@lucamrgs lucamrgs linked a pull request Mar 11, 2024 that will close this issue
@MaartendeKruijf MaartendeKruijf added this to the SOARCA 1.0 milestone Mar 13, 2024
@MaartendeKruijf MaartendeKruijf linked a pull request Mar 13, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants