Skip to content

Conversation

@nikic
Copy link
Member

@nikic nikic commented Oct 13, 2020

openssl_encrypt() currently throws a warning if the $tag out parameter is passed for a non-authenticated cipher. This violates the principle that a function should behave the same if a parameter is not passed, and if the default value is passed for the parameter.

I believe this warning should simply be dropped and the $tag be populated with null, as is already the case. Otherwise, it is not possible to use openssl_encrypt() in generic wrapper APIs, that are compatible with both authenticated and non-authenticated encryption.

(If we don't do this, we'll just mark the parameter as UNKNOWN.)

@nikic nikic requested a review from bukka October 13, 2020 15:01
@bukka
Copy link
Member

bukka commented Oct 13, 2020

Yeah I think it makes sense to suppress the warning. I'm fine with this going to lower branches too.

@php-pulls php-pulls closed this in 6c6a58e Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants