-
Notifications
You must be signed in to change notification settings - Fork 7.9k
snmp: add SHA256 and SHA512 for security protocol #7342
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
Conversation
16a232e
to
dbabd78
Compare
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.
Looks reasonable, just some style suggestions.
smart_string_appendl(&err, " or \"MD5\"", 9); | ||
#endif | ||
smart_string_0(&err); | ||
zend_value_error("%s", err.c); |
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'd find it more elegant to use smart_str and then do zend_throw_exception_zstr(zend_ce_value_error, err.s, 0)
here. No need to go through sprintf if we already have the full message :)
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.
Not using "%s" raise a security build warning
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.
[-Werror=format-security]
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.
Just to be clear, what I had in mind is using an API that uses zend_string (zend_throw_exception_zstr) and thus can just use the string directly. But your current version is okay as well.
This PR only add recommended protocol (not optional ones, don't think it really make sense to add them)