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

Remove/replace some code #4478

Closed
wants to merge 1 commit into from
Closed

Remove/replace some code #4478

wants to merge 1 commit into from

Conversation

richsalz
Copy link
Contributor

@richsalz richsalz commented Oct 6, 2017

Remove the -req-nodes flag from CA.pl
Rewrite ERR_string_error_n

@richsalz richsalz added branch: master Merge to master branch approval: review pending This pull request needs review by a committer labels Oct 6, 2017
@richsalz richsalz self-assigned this Oct 6, 2017
apps/CA.pl.in Outdated
# create a certificate request
$RET = run("$REQ -new -nodes -keyout $NEWKEY -out $NEWREQ $DAYS $EXTRA{req}");
print "Request is in $NEWREQ, private key is in $NEWKEY\n" if $RET == 0;
die "Flag removed; please use -extra-req-nodes instead.\n";
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure that it's not -extra-req -nodes? And the message is confusing, because it gives you impression that it replaces -newreq-nodes, but it doesn't. It looks like alternative is -newreq -extra-req -nodes.

But what exactly is the license-able claim? Existence of the flag or its implementation? Because if latter, then one can as well do something like

} elsif ($WHAT =~ '/\-newreq(\-nodes)?/' ) {
    # create a certificate request
    $RET = run("$REQ -new $1 -keyout $NEWKEY -out $NEWREQ $DAYS $EXTRA{req}");
    print "Request is in $NEWREQ, private key is in $NEWKEY\n" if $RET == 0;

@richsalz
Copy link
Contributor Author

richsalz commented Oct 7, 2017

You cannot copyright a concept; the code has to be replaced. Your idea is a good one, additional commit pushed.

apps/CA.pl.in Outdated
@@ -131,9 +131,9 @@ if ($WHAT eq '-newcert' ) {
# create a certificate request
$RET = run("$REQ -new -keyout $NEWKEY -out $NEWREQ $DAYS $EXTRA{req}");
print "Request is in $NEWREQ, private key is in $NEWKEY\n" if $RET == 0;
} elsif ($WHAT eq '-newreq-nodes' ) {
} elsif ($WHAT eq /-newreq(\-nodes)?/ ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

No-no-no, suggestion was to remove this elsif and modify the preceding one. Well, now you can simply remove the preceding elsif. But either way modifying just two lines was not actual suggestion. Also note that it renders CHANGES entry misleading. I mean it reads "removed -newreq-nodes" while what happens here is "reimplemented -newreq-nodes".

However! It's not actually given that it makes sense to keep it. I mean even if reimplementation does it, we still might find it appropriate to omit it. Or at least to declare deprecated. In which case it would be appropriate to issue warning that reads "stop using this, use <this> instead."

Copy link
Contributor

Choose a reason for hiding this comment

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

And there is typo, it's not "$WHAT eq ..." but "$WHAT =~ ..."

Copy link
Contributor

Choose a reason for hiding this comment

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

And it was /\-new..., not /-new.... Well, /-new.../ works, but it looks ambiguous and hence less readable.

@richsalz
Copy link
Contributor Author

richsalz commented Oct 7, 2017

I think we have to keep it in the .1 release. But I updated the commit and fixes all the silly mistakes you pointed out just before. Thanks.

Copy link
Contributor

@dot-asm dot-asm left a comment

Choose a reason for hiding this comment

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

Approved assuming that commits will be squashed.

@dot-asm dot-asm removed the approval: review pending This pull request needs review by a committer label Oct 7, 2017
Rewrite the -req-nodes flag from CA.pl (idea from Andy)
Rewrite ERR_string_error_n
@dot-asm
Copy link
Contributor

dot-asm commented Oct 7, 2017

On closer look I have additional comment...

levitte pushed a commit that referenced this pull request Oct 7, 2017
Rewrite the -req-nodes flag from CA.pl (idea from Andy)
Rewrite ERR_string_error_n

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from #4478)
@richsalz
Copy link
Contributor Author

richsalz commented Oct 7, 2017

okay, separate PR. what's the issue you've got?

@@ -127,13 +127,9 @@ if ($WHAT eq '-newcert' ) {
# create a pre-certificate
$RET = run("$REQ -x509 -precert -keyout $NEWKEY -out $NEWCERT $DAYS");
print "Pre-cert is in $NEWCERT, private key is in $NEWKEY\n" if $RET == 0;
} elsif ($WHAT eq '-newreq' ) {
} elsif ($WHAT =~ /\-newreq(\-nodes)?/ ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Formally speaking one wants equivalent code, and the replacement is not. One has to add ^ in beginning and $ at the end to make it equivalent to the original. Could you throw these two in, please?

@dot-asm
Copy link
Contributor

dot-asm commented Oct 7, 2017

Oh! I didn't notice that it was committed already... It probably doesn't really have to be additional request, I'd say just add additional commit and I'll approve it separately... Well, you decide...

@richsalz
Copy link
Contributor Author

richsalz commented Oct 7, 2017

See #4483
This is merged.

@richsalz richsalz closed this Oct 7, 2017
@mattcaswell
Copy link
Member

Too late now...but we really should split these things into two halfs - removal and replacement, i.e. two different commits

@mattcaswell
Copy link
Member

Given that the original contributor has now given permission for the new licence should we revert this?

@richsalz
Copy link
Contributor Author

richsalz commented Oct 8, 2017

Nah, this is better.

@richsalz richsalz deleted the remove-djm branch October 8, 2017 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch: master Merge to master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants