Skip to content

Bug #38917 - Native SPKAC support request #267

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

Closed
wants to merge 16 commits into from
Closed

Bug #38917 - Native SPKAC support request #267

wants to merge 16 commits into from

Conversation

jas-
Copy link
Contributor

@jas- jas- commented Jan 30, 2013

Wed Jan 30 09:06:49 MST 2013 - Pull request addressing feature request #38917 for native SPKAC support. Four new functions along with test cases:

(string) openssl_spki_new((object) private_key, (string) challenge, (int) algorithm)
(bool) openssl_spki_verify((string) spkac)
(string) openssl_spki_export((string) spkac)
(string) openssl_spki_export_challenge((string) spkac)

@@ -242,6 +245,16 @@ enum php_openssl_cipher_type {
ZEND_ARG_INFO(0, key)
ZEND_END_ARG_INFO()

#if OPENSSL_VERSION_NUMBER >= 0x10000000L
ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pbkdf2, 0, 0, 4)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this supposed to be part of the patch too? Discussion does not mention it...

@smalyshev
Copy link
Contributor

It would be nice to also add some tests for failure scenarios.

PHP_FUNCTION(openssl_spki_export)
{
int spkstr_len;
char *spkstr, * spkstr_cleaned, * s;
Copy link
Contributor

Choose a reason for hiding this comment

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

These variables are not initialized. This leads to segfault of wrong string.

@smalyshev
Copy link
Contributor

This code segfaults: php -r 'var_dump(openssl_spki_export("2438"));'
Probably because of missing variable initializations. Please clean it up and add failure scenario tests.

@jas-
Copy link
Contributor Author

jas- commented Feb 20, 2013

@smalyshev I have fixed the requested memory leak, changed the internal function away from the proto keyword and created error test cases as requested. Thanks for your help!

@jas-
Copy link
Contributor Author

jas- commented Mar 30, 2013

@smalyshev sorry if your busy with other things, when you get a minute I was just wondering about the status of this patch.

@smalyshev
Copy link
Contributor

@jas- Well, right now for 5.5 we need approval of the RM (Julien Pauli) or we'll have to wait for 5.5.1.

@jas-
Copy link
Contributor Author

jas- commented Mar 31, 2013

Great, thanks!

jas- added 7 commits April 28, 2013 22:34
* PHP-5.4: (22175 commits)
  fix valgrind warning
  Fix bug #64023 (__toString() & SplFileInfo)
  Fix test related to change for #bug64007 and also fix in newInstanceArgs
  NEWS: Start PHP 5.5.0 Beta 1 section
  NEWS for PHP 5.5.0alpha4
  Fix NEWS
  fix tests
  Merge fix of #62836 to ?.re, and regenerate ?.c
  Fixed bug #64007 (There is an ability to create instance of Generator by hand).
  - Fixed ZTS build
  Class Name Resolution As Scalar Via "class" Keyword
  fix bug #63462 (Magic methods called twice for unset protected properties)
  NEWS for bug #64011. See 77ee200
  Fix bug #64011 (get_html_translation_table())
  Update config.sub to latest GPLv2 upstream version
  Fixed bug #63988 (Two Date tests fail) only for PHP-5.5
  Fix skipif section
  Added ARM accelerated implementations for ZEND_SIGNED_MULTIPLY_LONG()
  Added test cases for ZEND_SIGNED_MULTIPLY_LONG()
  Fix News
  ...
* PHP-5.5:
  Sat Apr  7 21:02:37 MDT 2012 - Fixed segfaults and should just need to clean up any memory leaks
  Tue Apr  3 22:27:41 MDT 2012 - Split SPKI family of test cases into individual files as requested
  Tue Apr  3 21:21:20 MDT 2012 - Additional checks for supported algorithm types
  Tue Apr  3 14:41:40 MDT 2012 - SPKI functions, recommended changes and patch for bug id #61421
  Tue Apr  3 14:40:49 MDT 2012 - SPKI functions, recommended changes and patch for bug id #61421

Conflicts:
	ext/openssl/openssl.c
	ext/openssl/tests/openssl_spki_export.phpt
	ext/openssl/tests/openssl_spki_export_challenge.phpt
	ext/openssl/tests/openssl_spki_new.phpt
	ext/openssl/tests/openssl_spki_verify.phpt
@pierrejoye
Copy link
Contributor

Can you do a PR with the latest code? Or request an account to maintain it in ext/openssl? add me as sponsor.

Thanks for your work!

@jas-
Copy link
Contributor Author

jas- commented May 1, 2013

No problem, its only a small contribution @pierrejoye. I ran into some snags getting the upstream PHP 5.5 changes merged into my local branch but they have been resolved and all changes should now be in this pull request.

Asking for an account involves posting a message to internals I am assuming?

@kaplanlior
Copy link
Contributor

@jas- a mail to internals would be a good start, but you also have to use this form: http://www.php.net/git-php.php

@jas-
Copy link
Contributor Author

jas- commented Jul 17, 2013

Strange, that happened quite a while ago and was pushed to master @ git.php.net. I believe there is a freeze on new features which is why it isn't closed yet

Jason Gerfen

http://www.github.com/jas-

On Jul 17, 2013, at 4:40 PM, Lior Kaplan notifications@github.com wrote:

@jas- a mail to internals would be a good start, but you also have to use this form: http://www.php.net/git-php.php


Reply to this email directly or view it on GitHub.

@kaplanlior
Copy link
Contributor

@jas- You're right, committed in http://git.php.net/?p=php-src.git;a=commit;h=8f56ac8401ed1c3e00b8fba3fb8e5efb565180c4 and the bug should also be closed.

@php-pulls
Copy link

Comment on behalf of stas at php.net:

merged

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.

5 participants