2018-01-23 13:02:49 +01:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
|
|
|
*
|
|
|
|
* Copyright 2018, Adriaan de Groot <groot@kde.org>
|
|
|
|
*
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calamares is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "CheckPWQuality.h"
|
|
|
|
|
|
|
|
#include "utils/Logger.h"
|
|
|
|
|
2018-02-07 16:29:36 +01:00
|
|
|
#include <QCoreApplication>
|
2018-01-23 20:19:27 +01:00
|
|
|
#include <QString>
|
2018-01-23 13:02:49 +01:00
|
|
|
#include <QWidget>
|
|
|
|
|
2018-01-23 16:21:44 +01:00
|
|
|
#ifdef HAVE_LIBPWQUALITY
|
|
|
|
#include <pwquality.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2018-01-23 13:02:49 +01:00
|
|
|
PasswordCheck::PasswordCheck()
|
|
|
|
: m_message()
|
2018-03-06 16:10:31 +01:00
|
|
|
, m_accept( []( const QString& ){ return true; } )
|
2018-01-23 13:02:49 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PasswordCheck::PasswordCheck( const QString& m, AcceptFunc a )
|
|
|
|
: m_message( [m](){ return m; } )
|
|
|
|
, m_accept( a )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
PasswordCheck::PasswordCheck( MessageFunc m, AcceptFunc a )
|
|
|
|
: m_message( m )
|
|
|
|
, m_accept( a )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-01-23 20:19:27 +01:00
|
|
|
DEFINE_CHECK_FUNC( minLength )
|
2018-01-23 13:02:49 +01:00
|
|
|
{
|
|
|
|
int minLength = -1;
|
|
|
|
if ( value.canConvert( QVariant::Int ) )
|
|
|
|
minLength = value.toInt();
|
|
|
|
if ( minLength > 0 )
|
|
|
|
{
|
|
|
|
cDebug() << " .. minLength set to" << minLength;
|
|
|
|
checks.push_back(
|
|
|
|
PasswordCheck(
|
2018-02-07 16:29:36 +01:00
|
|
|
[]()
|
2018-01-23 13:02:49 +01:00
|
|
|
{
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Password is too short" );
|
2018-01-23 13:02:49 +01:00
|
|
|
},
|
|
|
|
[minLength]( const QString& s )
|
|
|
|
{
|
|
|
|
return s.length() >= minLength;
|
|
|
|
}
|
|
|
|
) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-23 20:19:27 +01:00
|
|
|
DEFINE_CHECK_FUNC( maxLength )
|
2018-01-23 13:02:49 +01:00
|
|
|
{
|
|
|
|
int maxLength = -1;
|
|
|
|
if ( value.canConvert( QVariant::Int ) )
|
|
|
|
maxLength = value.toInt();
|
|
|
|
if ( maxLength > 0 )
|
|
|
|
{
|
|
|
|
cDebug() << " .. maxLength set to" << maxLength;
|
|
|
|
checks.push_back(
|
|
|
|
PasswordCheck(
|
2018-02-07 16:29:36 +01:00
|
|
|
[]()
|
2018-01-23 13:02:49 +01:00
|
|
|
{
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate("PWQ", "Password is too long" );
|
2018-01-24 11:03:58 +01:00
|
|
|
},
|
|
|
|
[maxLength]( const QString& s )
|
2018-01-23 13:02:49 +01:00
|
|
|
{
|
|
|
|
return s.length() <= maxLength;
|
|
|
|
}
|
|
|
|
) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_LIBPWQUALITY
|
2019-04-11 14:59:25 +02:00
|
|
|
/* NOTE:
|
|
|
|
*
|
|
|
|
* The munge*() functions are here because libpwquality uses void* to
|
|
|
|
* represent user-data in callbacks and as a general "pass some parameter"
|
|
|
|
* type. These need to be munged to the right C++ type.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/// @brief Handle libpwquality using void* to represent a long
|
|
|
|
static inline long mungeLong( void* p )
|
|
|
|
{
|
|
|
|
return static_cast<long>( reinterpret_cast<intptr_t>( p ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
/// @brief Handle libpwquality using void* to represent a char*
|
|
|
|
static inline const char* mungeString( void* p )
|
|
|
|
{
|
|
|
|
return reinterpret_cast<const char*>( p );
|
|
|
|
}
|
|
|
|
|
2018-01-23 16:21:44 +01:00
|
|
|
/**
|
|
|
|
* Class that acts as a RAII placeholder for pwquality_settings_t pointers.
|
|
|
|
* Gets a new pointer and ensures it is deleted only once; provides
|
|
|
|
* convenience functions for setting options and checking passwords.
|
|
|
|
*/
|
|
|
|
class PWSettingsHolder
|
|
|
|
{
|
|
|
|
public:
|
2018-01-23 20:19:27 +01:00
|
|
|
static constexpr int arbitrary_minimum_strength = 40;
|
|
|
|
|
2018-01-23 16:21:44 +01:00
|
|
|
PWSettingsHolder()
|
|
|
|
: m_settings( pwquality_default_settings() )
|
2018-01-23 20:19:27 +01:00
|
|
|
, m_auxerror( nullptr )
|
2018-01-23 16:21:44 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
~PWSettingsHolder()
|
|
|
|
{
|
|
|
|
pwquality_free_settings( m_settings );
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Sets an option via the configuration string @p v, <key>=<value> style.
|
|
|
|
int set( const QString& v )
|
|
|
|
{
|
|
|
|
return pwquality_set_option( m_settings, v.toUtf8().constData() );
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Checks the given password @p pwd against the current configuration
|
|
|
|
int check( const QString& pwd )
|
|
|
|
{
|
2018-01-23 20:19:27 +01:00
|
|
|
void* auxerror = nullptr;
|
|
|
|
int r = pwquality_check( m_settings, pwd.toUtf8().constData(), nullptr, nullptr, &auxerror );
|
|
|
|
m_rv = r;
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool hasExplanation() const
|
|
|
|
{
|
|
|
|
return m_rv < 0;
|
2018-01-23 16:21:44 +01:00
|
|
|
}
|
|
|
|
|
2018-01-23 20:19:27 +01:00
|
|
|
/* This is roughly the same as the function pwquality_strerror,
|
|
|
|
* only with QStrings instead, and using the Qt translation scheme.
|
|
|
|
* It is used under the terms of the GNU GPL v3 or later, as
|
|
|
|
* allowed by the libpwquality license (LICENSES/GPLv2+-libpwquality)
|
|
|
|
*/
|
2018-02-07 17:12:49 +01:00
|
|
|
QString explanation()
|
2018-01-23 20:19:27 +01:00
|
|
|
{
|
|
|
|
void* auxerror = m_auxerror;
|
|
|
|
m_auxerror = nullptr;
|
|
|
|
|
|
|
|
if ( m_rv >= arbitrary_minimum_strength )
|
|
|
|
return QString();
|
|
|
|
if ( m_rv >= 0 )
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Password is too weak" );
|
2018-01-23 20:19:27 +01:00
|
|
|
|
|
|
|
switch ( m_rv )
|
|
|
|
{
|
|
|
|
case PWQ_ERROR_MEM_ALLOC:
|
|
|
|
if ( auxerror )
|
|
|
|
{
|
2019-04-11 14:59:25 +02:00
|
|
|
QString s = QCoreApplication::translate( "PWQ", "Memory allocation error when setting '%1'" ).arg( mungeString( auxerror ) );
|
2018-01-23 20:19:27 +01:00
|
|
|
free( auxerror );
|
|
|
|
return s;
|
|
|
|
}
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Memory allocation error" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_SAME_PASSWORD:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password is the same as the old one" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_PALINDROME:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password is a palindrome" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_CASE_CHANGES_ONLY:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password differs with case changes only" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_TOO_SIMILAR:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password is too similar to the old one" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_USER_CHECK:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains the user name in some form" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_GECOS_CHECK:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains words from the real name of the user in some form" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_BAD_WORDS:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains forbidden words in some form" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_MIN_DIGITS:
|
|
|
|
if ( auxerror )
|
2019-04-11 14:59:25 +02:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains less than %1 digits" ).arg( mungeLong( auxerror ) );
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains too few digits" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_MIN_UPPERS:
|
|
|
|
if ( auxerror )
|
2019-04-11 14:59:25 +02:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains less than %1 uppercase letters" ).arg( mungeLong( auxerror ) );
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains too few uppercase letters" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_MIN_LOWERS:
|
|
|
|
if ( auxerror )
|
2019-04-11 14:59:25 +02:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains less than %1 lowercase letters" ).arg( mungeLong( auxerror ) );
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains too few lowercase letters" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_MIN_OTHERS:
|
|
|
|
if ( auxerror )
|
2019-04-11 14:59:25 +02:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains less than %1 non-alphanumeric characters" ).arg( mungeLong( auxerror ) );
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains too few non-alphanumeric characters" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_MIN_LENGTH:
|
|
|
|
if ( auxerror )
|
2019-04-11 14:59:25 +02:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password is shorter than %1 characters" ).arg( mungeLong( auxerror ) );
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password is too short" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_ROTATED:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password is just rotated old one" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_MIN_CLASSES:
|
|
|
|
if ( auxerror )
|
2019-04-11 14:59:25 +02:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains less than %1 character classes" ).arg( mungeLong( auxerror ) );
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password does not contain enough character classes" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_MAX_CONSECUTIVE:
|
|
|
|
if ( auxerror )
|
2019-04-11 14:59:25 +02:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains more than %1 same characters consecutively" ).arg( mungeLong( auxerror ) );
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains too many same characters consecutively" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_MAX_CLASS_REPEAT:
|
|
|
|
if ( auxerror )
|
2019-04-11 14:59:25 +02:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains more than %1 characters of the same class consecutively" ).arg( mungeLong( auxerror ) );
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains too many characters of the same class consecutively" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_MAX_SEQUENCE:
|
|
|
|
if ( auxerror )
|
2019-04-11 14:59:25 +02:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains monotonic sequence longer than %1 characters" ).arg( mungeLong( auxerror ) );
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password contains too long of a monotonic character sequence" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_EMPTY_PASSWORD:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "No password supplied" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_RNG:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Cannot obtain random numbers from the RNG device" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_GENERATION_FAILED:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Password generation failed - required entropy too low for settings" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_CRACKLIB_CHECK:
|
|
|
|
if ( auxerror )
|
|
|
|
{
|
|
|
|
/* Here the string comes from cracklib, don't free? */
|
2019-04-11 14:59:25 +02:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password fails the dictionary check - %1" ).arg( mungeString( auxerror ) );
|
2018-01-23 20:19:27 +01:00
|
|
|
}
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The password fails the dictionary check" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_UNKNOWN_SETTING:
|
|
|
|
if ( auxerror )
|
|
|
|
{
|
2019-04-11 14:59:25 +02:00
|
|
|
QString s = QCoreApplication::translate( "PWQ", "Unknown setting - %1" ).arg( mungeString( auxerror ) );
|
2018-01-23 20:19:27 +01:00
|
|
|
free( auxerror );
|
|
|
|
return s;
|
|
|
|
}
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Unknown setting" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_INTEGER:
|
|
|
|
if ( auxerror )
|
|
|
|
{
|
2019-04-11 14:59:25 +02:00
|
|
|
QString s = QCoreApplication::translate( "PWQ", "Bad integer value of setting - %1" ).arg( mungeString( auxerror ) );
|
2018-01-23 20:19:27 +01:00
|
|
|
free( auxerror );
|
|
|
|
return s;
|
|
|
|
}
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Bad integer value" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_NON_INT_SETTING:
|
|
|
|
if ( auxerror )
|
|
|
|
{
|
2019-04-11 14:59:25 +02:00
|
|
|
QString s = QCoreApplication::translate( "PWQ", "Setting %1 is not of integer type" ).arg( mungeString( auxerror ) );
|
2018-01-23 20:19:27 +01:00
|
|
|
free( auxerror );
|
|
|
|
return s;
|
|
|
|
}
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Setting is not of integer type" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_NON_STR_SETTING:
|
|
|
|
if ( auxerror )
|
|
|
|
{
|
2019-04-11 14:59:25 +02:00
|
|
|
QString s = QCoreApplication::translate( "PWQ", "Setting %1 is not of string type" ).arg( mungeString( auxerror ) );
|
2018-01-23 20:19:27 +01:00
|
|
|
free( auxerror );
|
|
|
|
return s;
|
|
|
|
}
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Setting is not of string type" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_CFGFILE_OPEN:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Opening the configuration file failed" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_CFGFILE_MALFORMED:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "The configuration file is malformed" );
|
2018-01-23 20:19:27 +01:00
|
|
|
case PWQ_ERROR_FATAL_FAILURE:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Fatal failure" );
|
2018-01-23 20:19:27 +01:00
|
|
|
default:
|
2018-02-07 16:29:36 +01:00
|
|
|
return QCoreApplication::translate( "PWQ", "Unknown error" );
|
2018-01-23 20:19:27 +01:00
|
|
|
}
|
|
|
|
}
|
2018-02-08 10:33:40 +01:00
|
|
|
|
2018-01-23 16:21:44 +01:00
|
|
|
private:
|
|
|
|
pwquality_settings_t* m_settings;
|
2018-01-23 20:19:27 +01:00
|
|
|
int m_rv;
|
|
|
|
void* m_auxerror;
|
2018-01-23 16:21:44 +01:00
|
|
|
} ;
|
|
|
|
|
2018-01-23 20:19:27 +01:00
|
|
|
DEFINE_CHECK_FUNC( libpwquality )
|
2018-01-23 13:02:49 +01:00
|
|
|
{
|
2018-01-23 15:28:49 +01:00
|
|
|
if ( !value.canConvert( QVariant::List ) )
|
|
|
|
{
|
2018-02-13 11:07:12 +01:00
|
|
|
cWarning() << "libpwquality settings is not a list";
|
2018-01-23 15:28:49 +01:00
|
|
|
return;
|
|
|
|
}
|
2018-01-23 13:02:49 +01:00
|
|
|
|
2018-01-23 15:28:49 +01:00
|
|
|
QVariantList l = value.toList();
|
|
|
|
unsigned int requirement_count = 0;
|
2018-01-23 16:21:44 +01:00
|
|
|
auto settings = std::make_shared<PWSettingsHolder>();
|
2018-01-23 15:28:49 +01:00
|
|
|
for ( const auto& v : l )
|
|
|
|
{
|
2018-01-23 20:19:27 +01:00
|
|
|
if ( v.type() == QVariant::String )
|
2018-01-23 16:21:44 +01:00
|
|
|
{
|
|
|
|
QString option = v.toString();
|
|
|
|
int r = settings->set( option );
|
2018-01-23 20:19:27 +01:00
|
|
|
if ( r )
|
2018-02-13 11:07:12 +01:00
|
|
|
cWarning() << "unrecognized libpwquality setting" << option;
|
2018-01-23 16:21:44 +01:00
|
|
|
else
|
|
|
|
{
|
|
|
|
cDebug() << " .. libpwquality setting" << option;
|
|
|
|
++requirement_count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2018-02-13 11:07:12 +01:00
|
|
|
cWarning() << "unrecognized libpwquality setting" << v;
|
2018-01-23 16:21:44 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Something actually added? */
|
2018-01-23 20:19:27 +01:00
|
|
|
if ( requirement_count )
|
2018-01-23 16:21:44 +01:00
|
|
|
{
|
|
|
|
checks.push_back(
|
|
|
|
PasswordCheck(
|
2018-02-07 17:12:49 +01:00
|
|
|
[settings]()
|
2018-01-23 16:21:44 +01:00
|
|
|
{
|
2018-02-07 17:12:49 +01:00
|
|
|
return settings->explanation();
|
2018-01-23 16:21:44 +01:00
|
|
|
},
|
|
|
|
[settings]( const QString& s )
|
|
|
|
{
|
|
|
|
int r = settings->check( s );
|
|
|
|
if ( r < 0 )
|
2018-02-13 11:07:12 +01:00
|
|
|
cWarning() << "libpwquality error" << r;
|
2018-01-23 20:19:27 +01:00
|
|
|
else if ( r < settings->arbitrary_minimum_strength )
|
2018-01-23 16:21:44 +01:00
|
|
|
cDebug() << "Password strength" << r << "too low";
|
2018-01-23 20:19:27 +01:00
|
|
|
return r >= settings->arbitrary_minimum_strength;
|
2018-01-23 16:21:44 +01:00
|
|
|
}
|
|
|
|
) );
|
2018-01-23 15:28:49 +01:00
|
|
|
}
|
2018-01-23 13:02:49 +01:00
|
|
|
}
|
|
|
|
#endif
|