[Home]

Summary:ASTERISK-28750: TLS/SSL Key too small error
Reporter:Martin Zeh (martinzeh)Labels:patch webrtc
Date Opened:2020-02-19 08:16:57.000-0600Date Closed:2020-02-21 09:02:14.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Core/HTTP
Versions:17.2.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 0001-tcptls.c-Log-more-informative-OpenSSL-errors.patch
Description:Setup error while following documentation:
"Configuring Asterisk for WebRTC Clients"

contrib/scripts/ast_tls_cert does not generate a valid key

For my self compiled asterisk 17.2.0 the generated certificate and key is too small. The key is only 1024 bytes and this is not enough for the openssl version i linked to the asterisk.

So I want to request two enhancements:
1) amend the script "contrib/scripts/ast_tls_cert" to generate at least 2048 long keys - this is done by replace 1024 with 2048 in the script.

2) amend the source code tcptls.c
   The openssl function SSL_CTX_use_certificate_chain_file return an error, but the error is not printed to the logging facility.
The user only see the error message
tcptls.c: TLS/SSL error loading cert file
but not the reason - in my case: "SSL routines:SSL_CTX_use_certificate:ee key too small:../ssl/ssl_rsa.c:310:"

Comments:By: Asterisk Team (asteriskteam) 2020-02-19 08:16:58.874-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Sean Bright (seanbright) 2020-02-19 09:35:22.662-0600

[~martinzeh], can you try [the attached patch|^0001-tcptls.c-Log-more-informative-OpenSSL-errors.patch] and let us know if that helps with the error messages?

By: Martin Zeh (martinzeh) 2020-02-19 10:37:32.224-0600

I get an compilation error

  [CC] tcptls.c -> tcptls.o
tcptls.c: In function ‘log_openssl_error_stack’:
tcptls.c:118:3: warning: implicit declaration of function ‘ERR_print_errors_fp’; did you mean ‘ast_print_group’? [-Wimplicit-function-declaration]
  ERR_print_errors_fp(fp);
  ^~~~~~~~~~~~~~~~~~~

After inserting an include statement:
#include <openssl/err.h>

it compiles and the error log provides the information i need and hopefully other people

Thanks a lot!

Best regards
  Martin

By: Friendly Automation (friendly-automation) 2020-02-21 09:02:15.366-0600

Change 13812 merged by George Joseph:
tcptls.c: Log more informative OpenSSL errors

[https://gerrit.asterisk.org/c/asterisk/+/13812|https://gerrit.asterisk.org/c/asterisk/+/13812]

By: Friendly Automation (friendly-automation) 2020-02-21 09:02:34.510-0600

Change 13813 merged by George Joseph:
tcptls.c: Log more informative OpenSSL errors

[https://gerrit.asterisk.org/c/asterisk/+/13813|https://gerrit.asterisk.org/c/asterisk/+/13813]

By: Friendly Automation (friendly-automation) 2020-02-21 09:02:48.521-0600

Change 13826 merged by George Joseph:
tcptls.c: Log more informative OpenSSL errors

[https://gerrit.asterisk.org/c/asterisk/+/13826|https://gerrit.asterisk.org/c/asterisk/+/13826]

By: Friendly Automation (friendly-automation) 2020-02-21 09:03:07.342-0600

Change 13827 merged by George Joseph:
tcptls.c: Log more informative OpenSSL errors

[https://gerrit.asterisk.org/c/asterisk/+/13827|https://gerrit.asterisk.org/c/asterisk/+/13827]