Project

General

Profile

Actions

Bug #9443

closed

Captive Portal Vouchers feature is broken in 2.5.0

Added by A FL almost 5 years ago. Updated almost 5 years ago.

Status:
Resolved
Priority:
Normal
Category:
Captive Portal
Target version:
Start date:
03/31/2019
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.5.0
Affected Architecture:

Description

Hello,

When enabling vouchers on 2.5.0, fields "Voucher Public Key" and "Voucher Private Key" are empty, and clicking on "Generate new keys" has no effect.

The error seems to come from OpenSSL v1.1.1 that now prevent an RSA key under 512 bits to be generated :

The C++ constant preventing RSA keys to be generated is defined here : https://github.com/pfsense/FreeBSD-src/blob/RELENG_2_5/crypto/openssl/crypto/rsa/rsa_locl.h#L14

Actions #2

Updated by Jim Pingle almost 5 years ago

  • Assignee set to Renato Botelho

Rather than patching OpenSSL, we could use a pure PHP implementation of RSA to generate the voucher keys:

http://phpseclib.sourceforge.net/

include_once('Crypt/RSA.php');
$rsa = new Crypt_RSA();
$key = $rsa->createKey(64);
$private_key = $key["privatekey"];
$public_key = $key["publickey"];

Similar to what we did for x509 CRLs for PHP 7.x.

The code above works with the files from that library copied to the host and with the directory it's in added to the PHP include path. The contents of the generated public and private keys are in the correct format.

We'd need to make a port for it, but that still seems like a better idea than patching OpenSSL.

Once the port is in place we can update the code to use it.

Actions #3

Updated by Renato Botelho almost 5 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by A FL almost 5 years ago

I can confirm that the changeset is working correctly.
This issue can be marked as resolved

Actions #5

Updated by Jim Pingle almost 5 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF