Skip to content

SRTP code guards cleanup#4908

Closed
FdaSilvaYY wants to merge 3 commits intoopenssl:masterfrom
FdaSilvaYY:srtp_cleanup
Closed

SRTP code guards cleanup#4908
FdaSilvaYY wants to merge 3 commits intoopenssl:masterfrom
FdaSilvaYY:srtp_cleanup

Conversation

@FdaSilvaYY
Copy link
Contributor

@FdaSilvaYY FdaSilvaYY commented Dec 11, 2017

The code-guards around code and variables for this extension can be improved.
Remove two unneeded global variables: my 2'cents to #4679

The "use_srtp" command-line option appears in the command options list, even when his support is disabled ...

Checklist
  • documentation is added or updated
  • tests are added or updated

apps/s_server.c Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't making sense to me.

apps/s_client.c Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not put this inside an #ifdef too?

Copy link
Contributor Author

@FdaSilvaYY FdaSilvaYY Dec 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it now becomes just a local variable instead of a global one.
The two places you note must be guarded together (or not), else compilers will raise an unused variable warnings.
Disabling the command-line option declaration and the use place of srtp_profiles is enough ... we can afford an unused pointer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to get an error that it's not supported instead of parsing something and then just ignoring it.

Copy link
Contributor Author

@FdaSilvaYY FdaSilvaYY Mar 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kroeckx : I just try to simplify the handling of NO_SRTP and make it more similar to the other options like NO_SRP or NO_PSK ...
None of the disable options are actually triggering an error message.

@mattcaswell mattcaswell added this to the 1.1.1 milestone Jan 24, 2018
Copy link
Contributor

@richsalz richsalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; @kroeckx ?

@richsalz richsalz self-assigned this Mar 7, 2018
@richsalz richsalz added the approval: review pending This pull request needs review by a committer label Mar 7, 2018
Copy link
Contributor

@kaduk kaduk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks okay to me, in terms of being consistent with the behavior of (e.g.) ocsp.
Let's give @kroeckx a day to pipe up before merging, though.

@kaduk kaduk added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Mar 12, 2018
@mattcaswell
Copy link
Member

@richsalz or @kaduk...looks like this is ready to go in?

@richsalz
Copy link
Contributor

I would like another reviewer (I dislike two from the same employer), especially since @kroeckx had issues with this.

@kroeckx
Copy link
Member

kroeckx commented Mar 21, 2018 via email

@richsalz
Copy link
Contributor

I agree, unsupported options should return an error message. The right way to do this is leave the code in the switch, and leave the enum definitions. Just remove the options from the big table. That way the 'opt-next' code can never return one of those options, it will instead return an error.

@richsalz
Copy link
Contributor

.. which is to say that the code does the right thing. :)

@FdaSilvaYY
Copy link
Contributor Author

... the code will do the right thing after this PR ;)

@richsalz
Copy link
Contributor

So @kroeckx are you okay with being listed as a reviewer? If not, I'd like someone additional before I merge. (Of course, someone else can merge if they don't feel as strongly.)

@kroeckx
Copy link
Member

kroeckx commented Mar 21, 2018 via email

@richsalz richsalz removed their assignment Mar 21, 2018
@richsalz
Copy link
Contributor

Okay, fair enough. Someone else can merge this, or someone else needs to review before I'll merge.

@richsalz
Copy link
Contributor

Merged to master, thanks!

@richsalz richsalz closed this Mar 21, 2018
levitte pushed a commit that referenced this pull request Mar 21, 2018
Add missing guards around STRP-related fields
Remove two unneeded global variables: my 2'cents to #4679
Merge definition and instantiation of srpsrvparm global.

Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Ben Kaduk <[email protected]>
Reviewed-by: Rich Salz <[email protected]>
(Merged from #4908)
@FdaSilvaYY FdaSilvaYY deleted the srtp_cleanup branch March 26, 2018 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: done This pull request has the required number of approvals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants