SPKAC functionality per feature request #38917 (part deux)#37
SPKAC functionality per feature request #38917 (part deux)#37jas- wants to merge 5 commits intophp:masterfrom jas-:master
Conversation
… patch for bug id #61421
… patch for bug id #61421
…dividual files as requested
There was a problem hiding this comment.
what this code is for? emalloc never returns NULL and sizeof(s) is a constant and you used s for sprintf anyway earlier.
There was a problem hiding this comment.
Perhaps I don't understand the question. sprintf() gets used after emalloc
There was a problem hiding this comment.
What is this code for: if (sizeof(s)<=0) {
There was a problem hiding this comment.
To ensure an SPKAC is created, I should modify that to be
if (sizeof(s)!=8) {There was a problem hiding this comment.
@jas- In which occasions would it not be created? As @smalyshev mentioned, emalloc is infallible. If it can't allocate the memory the program will terminate.
There was a problem hiding this comment.
Didn't think of that, over engineering it. WIll remove thanks @smalyshev & @nikic
There was a problem hiding this comment.
Also, sizeof(s) is always the same, it is a constant operation. It does not depend on anything, just returns size of char * type.
… clean up any memory leaks
There was a problem hiding this comment.
Wouldn't this RETURN leave spki and pkey not freed?
There was a problem hiding this comment.
I would much rather use a macro as I did in my original patch submission to free everything.
if (!NETSCAPE_SPKI_set_pubkey(spki, pkey)) {
goto cleanup;
I was however told I should move away from using those
There was a problem hiding this comment.
You can use macro, you can use goto if you're really careful (comment on it!) but you have to free stuff you allocated one way or another.
|
@jas- ping |
|
@jas- ping again |
Per bug id https://bugs.php.net/bug.php?id=38917, a patch to implement missing SPKAC functionality within the OpenSSL extension.
I have made recommended modifications per closed pull request id #21.