Skip to content

Commit

Permalink
New release 5.9.8.0
Browse files Browse the repository at this point in the history
FIX: Database backend setup and initialization was not working well with some PHP version
ENH: New option to force writing logs only in file (even if the backend is a database)
ENH: Spryng SMS provider support
ENH: PHP 8.2.x deprecated code cleaned (null for string parameters)
FIX: without2fa token can be now correctly converted to TOTP with default 30 seconds time interval
FIX: Without2fa tokens with prefix pin where not working with CHAP/MSCHAP/MSCHAPv2
FIX: Windows: radiusd.conf and clients.conf files removed from the distribution
    (they are created automatically when installing the services using radius_install.cmd)
ENH: Windows: -debug option removed from the radius module launcher
ENH: By design, Credential Provider check request don't wait any prefix. This behavior can now be overwrited.
  • Loading branch information
S y s C o / al committed Aug 27, 2024
1 parent 0617369 commit be1853b
Show file tree
Hide file tree
Showing 32 changed files with 3,821 additions and 362 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# Please check https://www\.multiOTP.net/ and you will find the magic button ;-)
#
# @author Andre Liechti, SysCo systemes de communication sa, <info@multiotp.net>
# @version 5.9.7.1
# @date 2023-12-03
# @version 5.9.8.0
# @date 2024-08-26
# @since 2013-11-29
# @copyright (c) 2013-2023 SysCo systemes de communication sa
# @copyright (c) 2013-2024 SysCo systemes de communication sa
# @copyright GNU Lesser General Public License
#
# docker build .
Expand Down Expand Up @@ -47,7 +47,7 @@ MAINTAINER Andre Liechti <andre.liechti@multiotp.net>
LABEL Description="multiOTP open source, running on Debian ${DEBIAN} with PHP${PHPVERSION}." \
License="LGPL-3.0" \
Usage="docker run -v [PATH/TO/MULTIOTP/DATA/VOLUME]:/etc/multiotp -v [PATH/TO/FREERADIUS/CONFIG/VOLUME]:/etc/freeradius -v [PATH/TO/MULTIOTP/LOG/VOLUME]:/var/log/multiotp -v [PATH/TO/FREERADIUS/LOG/VOLUME]:/var/log/freeradius -p [HOST WWW PORT NUMBER]:80 -p [HOST SSL PORT NUMBER]:443 -p [HOST RADIUS-AUTH PORT NUMBER]:1812/udp -p [HOST RADIUS-ACCNT PORT NUMBER]:1813/udp -d multiotp-open-source" \
Version="5.9.7.1"
Version="5.9.8.0"

ARG DEBIAN_FRONTEND=noninteractive

Expand Down
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ multiOTP open source
multiOTP open source is a GNU LGPL implementation of a strong two-factor authentication PHP class
multiOTP open source is OATH certified for HOTP/TOTP

(c) 2010-2023 SysCo systemes de communication sa
(c) 2010-2024 SysCo systemes de communication sa
https://www.multiotp.net/

Current build: 5.9.7.1 (2023-12-03)
Current build: 5.9.8.0 (2024-08-26)

Binary download: https://download.multiotp.net/ (including virtual appliance image)

Expand Down Expand Up @@ -158,6 +158,16 @@ WHAT'S NEW IN THIS 5.9.x RELEASE
CHANGE LOG OF RELEASED VERSIONS
===============================
```
2024-08-26 5.9.8.0 FIX: Database backend setup and initialization was not working well with some PHP version
ENH: New option to force writing logs only in file (even if the backend is a database)
ENH: Spryng SMS provider support
ENH: PHP 8.2.x deprecated code cleaned (null for string parameters)
2024-05-03 5.9.7.2 FIX: without2fa token can be now correctly converted to TOTP with default 30 seconds time interval
FIX: Without2fa tokens with prefix pin where not working with CHAP/MSCHAP/MSCHAPv2
FIX: Windows: radiusd.conf and clients.conf files removed from the distribution
(they are created automatically when installing the services using radius_install.cmd)
ENH: Windows: -debug option removed from the radius module launcher
ENH: By design, Credential Provider check request don't wait any prefix. This behavior can now be overwrited.
2023-12-03 5.9.7.1 FIX: Command line number of parameters detection corrected
ENH: It's now possible to define the number of digits for new created PIN
(multiotp -config default-pin-digits=n)
Expand Down Expand Up @@ -1906,8 +1916,8 @@ MULTIOTP COMMAND LINE TOOL
==========================

```
multiOTP 5.9.7.1 (2023-12-03)
(c) 2010-2023 SysCo systemes de communication sa
multiOTP 5.9.8.0 (2024-08-26)
(c) 2010-2024 SysCo systemes de communication sa
http://www.multiOTP.net (you can try the [Donate] button ;-)
multiotp will check if the token of a user is correct, based on a specified
Expand Down Expand Up @@ -2103,6 +2113,7 @@ Usage:
display-log: [0|1] enable/disable log display on the console
group-attribute: attribute to return for the group membership
(for example 'Filter-Id' for FreeRADIUS)
ignore-no-prefix-cp: [0|1] Disable 'no prefix' for Credential Provider
issuer: default name of the issuer of the (soft) token
ldap-account-suffix: LDAP/AD account suffix
ldap-activated: [0|1] enable/disable LDAP/AD support
Expand Down Expand Up @@ -2136,6 +2147,7 @@ Usage:
'auto' means '' for PHP higher than 5.x and
'NORMAL:!VERS-TLS1.2' for PHP 5.x and before
log: [0|1] enable/disable log permanently
log-forced-in-file: [0|1] enable/disable log always in file (no DB)
multiple-groups: [0|1] enable/disable multiple groups per user
radius-reply-attributor: [ += |=] how to attribute a value
('=' for TekRADIUS, ' += ' for FreeRADIUS)
Expand Down Expand Up @@ -2434,8 +2446,8 @@ Visit https://forum.multiotp.net/ for additional support
```

```
Hash verification for multiotp_5.9.7.1.zip
SHA256:1c20cc31c707245c9fd55a71c7e4d9204eae6a20eaba87099ffc62caf19ca59b
SHA1:e3ab1db6c0b62cc2afb2866117b13fe2506a1727
MD5:0cc3b0df1d5b760c53f7beade835817f
Hash verification for multiotp_5.9.8.0.zip
SHA256:13cfaad7da594014c106faec4a934d12d720ce92820b21816e6f0d5d4e1231e4
SHA1:9df76683482959dab99c2688332e7eaa3b4033b7
MD5:1d73c1f2c102b3243b1b21025cb412f5
```
8 changes: 4 additions & 4 deletions check.multiotp.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
* PHP 5.4.0 or higher is supported.
*
* @author Andre Liechti, SysCo systemes de communication sa, <info@multiotp.net>
* @version 5.9.7.1
* @date 2023-12-03
* @version 5.9.8.0
* @date 2024-08-26
* @since 2013-07-10
* @copyright (c) 2013-2023 SysCo systemes de communication sa
* @copyright (c) 2013-2024 SysCo systemes de communication sa
* @copyright GNU Lesser General Public License
*
*//*
*
* LICENCE
*
* Copyright (c) 2013-2023 SysCo systemes de communication sa
* Copyright (c) 2013-2024 SysCo systemes de communication sa
* SysCo (tm) is a trademark of SysCo systemes de communication sa
* (http://www.sysco.ch/)
* All rights reserved.
Expand Down
10 changes: 5 additions & 5 deletions checkmultiotp.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ REM
REM Windows batch file for Windows 2K/XP/2003/7/2008/8/2012/10/2019
REM
REM @author Andre Liechti, SysCo systemes de communication sa, <info@multiotp.net>
REM @version 5.9.7.1
REM @date 2023-12-03
REM @version 5.9.8.0
REM @date 2024-08-26
REM @since 2010-07-10
REM @copyright (c) 2010-2023 SysCo systemes de communication sa
REM @copyright (c) 2010-2024 SysCo systemes de communication sa
REM @copyright GNU Lesser General Public License
REM
REM
Expand All @@ -38,7 +38,7 @@ REM
REM
REM Licence
REM
REM Copyright (c) 2010-2023 SysCo systemes de communication sa
REM Copyright (c) 2010-2024 SysCo systemes de communication sa
REM SysCo (tm) is a trademark of SysCo systemes de communication sa
REM (http://www.sysco.ch/)
REM All rights reserved.
Expand Down Expand Up @@ -177,7 +177,6 @@ SET TOTAL_TESTS=0
REM SET initial backend to files
%_multiotp% -config backend-type=files


ECHO multiotp functionalities and HOTP implementation check
ECHO (RFC 4226, http://www.ietf.org/rfc/rfc4226.txt)
ECHO ------------------------------------------------------
Expand All @@ -202,6 +201,7 @@ REM Set the backend
ECHO.
ECHO Backend is set to %_backend%
%_multiotp% -config backend-type=%_backend%
%_multiotp% -config log-forced-in-file=0

ECHO Initialize backend
IF "mysql"=="%_backend%" %_multiotp% -display-log -initialize-backend
Expand Down
20 changes: 18 additions & 2 deletions contrib/MultiotpAdLdap.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,30 @@
*/

// Added by SysCo/al
if (!defined('PHP_VERSION_ID'))
if (!function_exists('constant_defined')) {
function constant_defined(
$constant_name
) {
$result = false;
foreach (get_defined_constants() as $key=>$value) {
if (strtoupper($key) == strtoupper($constant_name)) {
$result = true;
break;
}
}
return $result;
}
}


if (!constant_defined('PHP_VERSION_ID'))
{
$version = explode('.', PHP_VERSION);
define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
}
putenv('LDAPTLS_REQCERT=never');

if (!defined('LDAP_OPT_DIAGNOSTIC_MESSAGE')) {
if (!constant_defined('LDAP_OPT_DIAGNOSTIC_MESSAGE')) {
define ('LDAP_OPT_DIAGNOSTIC_MESSAGE', 0x0032);
}

Expand Down
64 changes: 61 additions & 3 deletions contrib/MultiotpSms.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class MultiotpSms
* @brief SMS message using any SMS Provider.
*
* @author Andre Liechti, SysCo systemes de communication sa, <info@multiotp.net>
* @version 5.9.7.0
* @date 2023-11-21
* @version 5.9.8.0
* @date 2024-08-26
* @since 2018-10-09
*
* Predefined providers:
Expand All @@ -21,6 +21,8 @@ class MultiotpSms
* nowsms: NowSMS.com (on-premises), https://www.nowsms.com/
* smseagle: SMSEagle (hardware gateway), https://www.smseagle.eu/
* smsgateway: SMSGateway (open source on-premises), https://github.com/multiOTP/SMSGateway
* spryng: Spryng (REST API), https://www.spryng.be
* spryngsimple: Spryng (Simple API), https://www.spryng.be
* swisscom: Swisscom LA (REST-JSON), https://messagingproxy.swisscom.ch:4300/rest/1.0.0/
* telnyx: Telnyx, https://developers.telnyx.com/docs/api/v2/messaging
*
Expand Down Expand Up @@ -71,6 +73,7 @@ class MultiotpSms
*
* Change Log
*
* 2024-08-26 5.9.8.0 SysCo/al default_values added (for example: "ip=xxxx;port=yyy")
* 2023-11-21 5.9.7.0 SysCo/al Cleaned code
* 2023-03-21 5.9.5.8 SysCo/al smsgateway provider added
* Specific URL can be specified in the constructor
Expand Down Expand Up @@ -109,6 +112,7 @@ class MultiotpSms
var $basic_auth;
var $content_encoding;
var $header;
var $default_values;

// Timeout
var $timeout;
Expand All @@ -124,7 +128,15 @@ class MultiotpSms
var $reply_content;


function __construct(
function setProperty($property, $value) {
$this->$property = $value;
}

function getProperty($property) {
return $this->$property;
}

function __construct(
$config_array = array()
) {
$this->resetValues();
Expand All @@ -151,6 +163,7 @@ function __construct(
if (isset($config_array['debug'])) { $this->debug = (TRUE == $config_array['debug']); }
if (isset($config_array['timeout'])) { $this->timeout = intval($config_array['timeout']); }
if (isset($config_array['encode_ampersand'])) { $this->encode_ampersand = (TRUE == $config_array['encode_ampersand']); }
if (isset($config_array['default_values'])) { $this->default_values = $config_array['default_values']; }
if ($this->timeout < 1) {
$this->timeout = 5;
}
Expand Down Expand Up @@ -420,6 +433,44 @@ function setProvider(
$this->content_encoding = "";
$this->header = "";
break;
case 'spryng':
$this->url = "https://rest.spryngsms.com/v1/messages";
$this->send_template = "{\n".
" \"body\": \"%msg\",\n".
" \"encoding\": \"auto\",\n".
" \"originator\": \"%from\",\n".
" \"recipients\": [\n".
" \"%to\"\n".
" ],\n".
" \"route\": \"%ip\"\n".
"}";
$this->method = "POST-JSON";
$this->encoding = "UTF";
$this->status_success = "20";
$this->content_success = "";
$this->no_double_zero = TRUE;
$this->international_format = FALSE;
$this->basic_auth = FALSE;
$this->content_encoding = "QUOTES";
$this->header = "Authorization: Bearer %api_id\r\n";
$this->default_values = "ip=business";
break;

case 'spryngsimple':
$this->url = "https://rest.spryngsms.com/api/simple/message?=null";
$this->send_template = "route=%ip&username=%user&secret=%pass&sender=%from&destination=%to&body=%msg";
$this->method = "POST";
$this->encoding = "UTF";
$this->status_success = "20";
$this->content_success = "";
$this->no_double_zero = TRUE;
$this->international_format = FALSE;
$this->basic_auth = FALSE;
$this->content_encoding = "";
$this->header = "";
$this->default_values = "ip=business";
break;

case 'swisscom':
$this->url = "https://messagingproxy.swisscom.ch:4300/rest/1.0.0/submit_sm/%api_id";
$this->send_template = "{\n".
Expand Down Expand Up @@ -734,6 +785,13 @@ function sendSMS(
if ($this->encode_ampersand) {
$payload_msg = str_replace('&', '%26', $payload_msg);
}

foreach (explode(";",$this->default_values) as $one_default_value_array) {
list($key, $value) = explode('=', $one_default_value_array);
if ("" == trim($this->getProperty($key))) {
$this->setProperty($key, $value);
}
}

$payload = str_replace('%ip', $this->ip, $payload);
if (intval($this->port) <= 0) {
Expand Down
38 changes: 33 additions & 5 deletions contrib/MultiotpTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,23 @@
* Check PHP version and define version constant if needed
* (PHP_VERSION_ID is natively available only for PHP >= 5.2.7)
****************************************************************/
if (!defined('PHP_VERSION_ID'))
if (!function_exists('constant_defined')) {
function constant_defined(
$constant_name
) {
$result = false;
foreach (get_defined_constants() as $key=>$value) {
if (strtoupper($key) == strtoupper($constant_name)) {
$result = true;
break;
}
}
return $result;
}
}


if (!constant_defined('PHP_VERSION_ID'))
{
$version = explode('.', PHP_VERSION);
define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
Expand All @@ -19,21 +35,29 @@


if (!function_exists('nullable_trim')) {
function nullable_trim($string) {
function nullable_trim(
$string
) {
return (is_null($string) ? "" : trim($string));
}
}


if (!function_exists('nullable_bin2hex')) {
function nullable_bin2hex($string) {
function nullable_bin2hex(
$string
) {
return (is_null($string) ? "" : bin2hex($string));
}
}


if (!function_exists('pcre_fnmatch')) {
function pcre_fnmatch($pattern, $string, $flags = 0) {
function pcre_fnmatch(
$pattern,
$string,
$flags = 0
) {
define('FNM_PATHNAME', 1);
define('FNM_NOESCAPE', 2);
define('FNM_PERIOD', 4);
Expand Down Expand Up @@ -81,7 +105,11 @@ function pcre_fnmatch($pattern, $string, $flags = 0) {


if (!function_exists('fnmatch')) {
function fnmatch($pattern, $string, $flags = 0) {
function fnmatch(
$pattern,
$string,
$flags = 0)
{
return pcre_fnmatch($pattern, $string, $flags);
}
}
Expand Down
8 changes: 4 additions & 4 deletions launcher/ReadMe.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ The multiOTP C++ launcher is simply used to launch PHP
and run multiotp.windows.php with the provided arguments.

@author Andre Liechti, SysCo systemes de communication sa, <info@multiotp.net>
@version 5.9.7.1
@date 2023-12-03
@version 5.9.8.0
@date 2024-08-26
@since 2016-12-08
@copyright (c) 2010-2023 SysCo systemes de communication sa
@copyright (c) 2010-2024 SysCo systemes de communication sa
@copyright GNU Lesser General Public License

LICENCE

Copyright (c) 2010-2023 SysCo systemes de communication sa
Copyright (c) 2010-2024 SysCo systemes de communication sa
SysCo (tm) is a trademark of SysCo systemes de communication sa
(http://www.sysco.ch)
All rights reserved.
Expand Down
Loading

0 comments on commit be1853b

Please sign in to comment.