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

Do not set load_crypto_strings_inited when OPENSSL_NO_ERR is defined #1654

Closed
wants to merge 1 commit into from
Closed

Conversation

matbech
Copy link
Contributor

@matbech matbech commented Oct 3, 2016

Only set the load_crypto_strings_inited to 1 when err_load_crypto_strings_int was called.

This solves the following issue:

  • openssl is built with no-err
  • load_crypto_strings_inited is set to 1 during the OPENSSL_init_crypto call
  • During the cleanup: OPENSSL_cleanup, err_free_strings_int is called because load_crypto_strings_inited == 1
  • err_free_strings_int calls do_err_strings_init because it has never been called
  • Now do_err_strings_init calls OPENSSL_init_crypto
  • But since we are in the cleanup (stopped == 1) this results in an error:
    CRYPTOerr(CRYPTO_F_OPENSSL_INIT_CRYPTO, ERR_R_INIT_FAIL);
  • which then tries to initialize everything we are trying to clean up: ERR_get_state, ossl_init_thread_start, etc

Only set the load_crypto_strings_inited to 1 when err_load_crypto_strings_int was called.

This solves the following issue:
- openssl is built with no-err
- load_crypto_strings_inited is set to 1 during the OPENSSL_init_crypto call
- During the cleanup: OPENSSL_cleanup, err_free_strings_int is called because load_crypto_strings_inited == 1
- err_free_strings_int calls do_err_strings_init because it has never been called
- Now do_err_strings_init calls OPENSSL_init_crypto
- But since we are in the cleanup (stopped == 1) this results in an error:
  CRYPTOerr(CRYPTO_F_OPENSSL_INIT_CRYPTO, ERR_R_INIT_FAIL);
- which then tries to initialize everything we are trying to clean up: ERR_get_state, ossl_init_thread_start, etc
@richsalz richsalz added reviewed branch: master Merge to master branch labels Oct 4, 2016
@richsalz richsalz self-assigned this Oct 4, 2016
@richsalz
Copy link
Contributor

richsalz commented Oct 4, 2016

+1
@matbech do you agree with me that this is a trivial fix?

@mattcaswell
Copy link
Member

To be clear we can only accept contributions with a CLA, unless all parties agree that they are trivial.

@matbech
Copy link
Contributor Author

matbech commented Oct 4, 2016

@richsalz Yes it is a trivial fix and I have already signed the CLA.

@t-j-h t-j-h added the approval: done This pull request has the required number of approvals label Oct 5, 2016
levitte pushed a commit that referenced this pull request Oct 19, 2016
Only set the load_crypto_strings_inited to 1 when err_load_crypto_strings_int was called.

This solves the following issue:
- openssl is built with no-err
- load_crypto_strings_inited is set to 1 during the OPENSSL_init_crypto call
- During the cleanup: OPENSSL_cleanup, err_free_strings_int is called because load_crypto_strings_inited == 1
- err_free_strings_int calls do_err_strings_init because it has never been called
- Now do_err_strings_init calls OPENSSL_init_crypto
- But since we are in the cleanup (stopped == 1) this results in an error:
  CRYPTOerr(CRYPTO_F_OPENSSL_INIT_CRYPTO, ERR_R_INIT_FAIL);
- which then tries to initialize everything we are trying to clean up: ERR_get_state, ossl_init_thread_start, etc
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #1654)
levitte pushed a commit that referenced this pull request Oct 19, 2016
Only set the load_crypto_strings_inited to 1 when err_load_crypto_strings_int was called.

This solves the following issue:
- openssl is built with no-err
- load_crypto_strings_inited is set to 1 during the OPENSSL_init_crypto call
- During the cleanup: OPENSSL_cleanup, err_free_strings_int is called because load_crypto_strings_inited == 1
- err_free_strings_int calls do_err_strings_init because it has never been called
- Now do_err_strings_init calls OPENSSL_init_crypto
- But since we are in the cleanup (stopped == 1) this results in an error:
  CRYPTOerr(CRYPTO_F_OPENSSL_INIT_CRYPTO, ERR_R_INIT_FAIL);
- which then tries to initialize everything we are trying to clean up: ERR_get_state, ossl_init_thread_start, etc
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #1654)
(cherry picked from commit a1f2b0e)
@richsalz
Copy link
Contributor

commit a1f2b0e in master 3d04039 in 1.1.0; thanks!

@richsalz richsalz closed this Oct 19, 2016
@matbech matbech deleted the patch-6 branch November 2, 2016 07:34
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 branch: master Merge to master branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants