Skip to Content.
Sympa Menu

sm-commit - [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (3bb529d415396aa89a2e81d3380366c8a77df354)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
  • Subject: [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (3bb529d415396aa89a2e81d3380366c8a77df354)
  • Date: Sat, 25 Jan 2025 19:08:34 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

ChangeLog
| 5
libs/zxcvbn-c/CONFIGURE
| 1
libs/zxcvbn-c/DEPENDS
| 1
libs/zxcvbn-c/DETAILS
| 45 ++++
libs/zxcvbn-c/HISTORY
| 5
libs/zxcvbn-c/PRE_BUILD
| 3

libs/zxcvbn-c/patches/0001-add-cmake-support-equivalent-to-the-original-makefil.patch
| 100 ++++++++++

libs/zxcvbn-c/patches/0002-Changed-the-compiler-warning-option-to-stop-warning-.patch
| 28 ++
libs/zxcvbn-c/patches/0003-Add-CMake-installation-rules.patch
| 25 ++
9 files changed, 212 insertions(+), 1 deletion(-)

New commits:
commit 3bb529d415396aa89a2e81d3380366c8a77df354
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

zxcvbn-c: new spell, Low-budget password strength estimator

diff --git a/ChangeLog b/ChangeLog
index bfda29b..0fdca21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
-2025-01-26 Justin Boffemmyer <flux AT sourcemage.org>
+2025-01-25 Ismael Luceno <ismael AT sourcemage.org>
+ * libs/zxcvbn-c: new spell, Low-budget password strength estimator
+
+2025-01-25 Justin Boffemmyer <flux AT sourcemage.org>
* wm-addons/tofi: new spell, fast and minimal Wayland launcher

2025-01-24 Justin Boffemmyer <flux AT sourcemage.org>
diff --git a/libs/zxcvbn-c/CONFIGURE b/libs/zxcvbn-c/CONFIGURE
new file mode 100755
index 0000000..b1e2770
--- /dev/null
+++ b/libs/zxcvbn-c/CONFIGURE
@@ -0,0 +1 @@
+. "$GRIMOIRE"/CMAKE_CONFIGURE
diff --git a/libs/zxcvbn-c/DEPENDS b/libs/zxcvbn-c/DEPENDS
new file mode 100755
index 0000000..bd2c258
--- /dev/null
+++ b/libs/zxcvbn-c/DEPENDS
@@ -0,0 +1 @@
+. "$GRIMOIRE"/CMAKE_DEPENDS
diff --git a/libs/zxcvbn-c/DETAILS b/libs/zxcvbn-c/DETAILS
new file mode 100755
index 0000000..5952f35
--- /dev/null
+++ b/libs/zxcvbn-c/DETAILS
@@ -0,0 +1,45 @@
+. "$GRIMOIRE"/CMAKE_FUNCTIONS
+ SPELL=zxcvbn-c
+ VERSION=2.5
+ SOURCE="$SPELL-$VERSION.tar.gz"
+
SOURCE_URL[0]=https://github.com/tsyrogit/$SPELL/archive/refs/tags/v$VERSION.tar.gz
+
SOURCE_HASH=sha512:d7199b3cc36cd0e401bd8f857132425908307aefcdb1bb635ee81c34cf71ccbcdf0fe36a336a55da1281692b508881b54773afa41379a448863095f4abd5c0e8
+SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
+ WEB_SITE="https://github.com/tsyrogit/zxcvbn-c";
+ LICENSE[0]="MIT"
+ ENTERED=20250123
+ KEYWORDS=""
+ SHORT="Low-budget password strength estimator"
+cat << EOF
+This is a C/C++ implementation of the zxcvbn password strength estimation.
+
+zxcvbn is a password strength estimator inspired by password crackers.
Through
+pattern matching and conservative estimation, it recognizes and weighs 30k
+common passwords, common names and surnames according to US census data,
+popular English words from Wikipedia and US television and movies, and other
+common patterns like dates, repeats (aaa), sequences (abcd), keyboard
patterns
+(qwertyuiop), and l33t speak.
+
+Consider using zxcvbn as an algorithmic alternative to password composition
+policy — it is more secure, flexible, and usable when sites require a
+minimal complexity score in place of annoying rules like "passwords must
+contain three of: lower, upper, numbers, symbols".
+
+* More secure: policies often fail both ways, allowing weak passwords
+ (P@ssword1) and disallowing strong passwords.
+* More flexible: zxcvbn allows many password styles to flourish so long as it
+ detects sufficient complexity — passphrases are rated highly given enough
+ uncommon words, keyboard patterns are ranked based on length and number
+ of turns, and capitalization adds more complexity when it's unpredictaBle.
+* More usable: zxcvbn is designed to power simple, rule-free interfaces that
+ give instant feedback. In addition to strength estimation, zxcvbn includes
+ minimal, targeted verbal feedback that can help guide users towards less
+ guessable passwords.
+
+Like the original this code is for character sets which use single byte
+characters primarily in the code range 0x20 to 0x7E.
+
+For further detail and motivation, please refer to:
+*
https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/wheeler
+*
https://blogs.dropbox.com/tech/2012/04/zxcvbn-realistic-password-strength-estimation/
+EOF
diff --git a/libs/zxcvbn-c/HISTORY b/libs/zxcvbn-c/HISTORY
new file mode 100644
index 0000000..e672aa6
--- /dev/null
+++ b/libs/zxcvbn-c/HISTORY
@@ -0,0 +1,5 @@
+2025-01-25 Ismael Luceno <ismael AT sourcemage.org>
+ * CONFIGURE, DEPENDS, DETAILS, PRE_BUILD,
+
patches/0001-add-cmake-support-equivalent-to-the-original-makefil.patch,
+
patches/0002-Changed-the-compiler-warning-option-to-stop-warning-.patch,
+ patches/0003-Add-CMake-installation-rules.patch: spell created
diff --git a/libs/zxcvbn-c/PRE_BUILD b/libs/zxcvbn-c/PRE_BUILD
new file mode 100755
index 0000000..c230ad1
--- /dev/null
+++ b/libs/zxcvbn-c/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches
diff --git
a/libs/zxcvbn-c/patches/0001-add-cmake-support-equivalent-to-the-original-makefil.patch

b/libs/zxcvbn-c/patches/0001-add-cmake-support-equivalent-to-the-original-makefil.patch
new file mode 100644
index 0000000..12ea882
--- /dev/null
+++
b/libs/zxcvbn-c/patches/0001-add-cmake-support-equivalent-to-the-original-makefil.patch
@@ -0,0 +1,100 @@
+From d5ef1234ed0624cb5eb1449b141b2d2636e82a85 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Hana=20Dusi=CC=81kova=CC=81?= <hana.dusikova AT gendigital.com>
+Date: Thu, 20 Jul 2023 08:39:21 +0200
+Subject: [PATCH 1/3] add cmake support equivalent to the original makefile
+
+Upstream-Status: Backport
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ CMakeLists.txt | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 79 insertions(+)
+ create mode 100644 CMakeLists.txt
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+new file mode 100644
+index 000000000000..9cf0ef78d329
+--- /dev/null
++++ b/CMakeLists.txt
+@@ -0,0 +1,79 @@
++cmake_minimum_required(VERSION 3.14)
++
++project(zxcvbn-c VERSION 0 LANGUAGES C CXX)
++
++add_executable(dictgen dict-generate.cpp)
++target_compile_features(dictgen PUBLIC cxx_std_11)
++target_compile_options(dictgen PRIVATE "-O3")
++
++add_compile_options("-Wextra" "-Wdeclaration-after-statement")
++
++find_library(LIBM m)
++
++# list of dictionaries
++set(WORDS words-eng_wiki.txt words-female.txt words-male.txt
words-passwd.txt words-surname.txt words-tv_film.txt)
++list(TRANSFORM WORDS PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/)
++
++# generate dict-src.h and dict-crc.h
++add_custom_command(OUTPUT dict-src.h COMMAND dictgen -o
${CMAKE_CURRENT_BINARY_DIR}/dict-src.h ${WORDS} DEPENDS dictgen ${WORDS}
COMMENT "Generating dict-src.h")
++
++add_custom_command(OUTPUT dict-crc.h zxcvbn.dict COMMAND dictgen -b -o
${CMAKE_CURRENT_BINARY_DIR}/zxcvbn.dict -h
${CMAKE_CURRENT_BINARY_DIR}/dict-crc.h ${WORDS} DEPENDS dictgen ${WORDS}
COMMENT "Generating dict-crc.h")
++
++# build shared version of library
++add_library(zxcvbn-shared SHARED zxcvbn.c dict-crc.h dict-src.h)
++target_include_directories(zxcvbn-shared PRIVATE
${CMAKE_CURRENT_BINARY_DIR})
++target_include_directories(zxcvbn-shared PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
++target_link_libraries(zxcvbn-shared PUBLIC ${LIBM})
++set_target_properties(zxcvbn-shared PROPERTIES
++ POSITION_INDEPENDENT_CODE ON
++ OUTPUT_NAME zxcvbn
++ VERSION ${CMAKE_PROJECT_VERSION}
++ SOVERSION ${PROJECT_VERSION_MAJOR}
++)
++
++# build static version of library
++add_library(zxcvbn-static STATIC zxcvbn.c dict-crc.h dict-src.h)
++target_include_directories(zxcvbn-static PRIVATE
${CMAKE_CURRENT_BINARY_DIR} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
++target_link_libraries(zxcvbn-static PUBLIC ${LIBM})
++set_target_properties(zxcvbn-static PROPERTIES OUTPUT_NAME zxcvbn)
++
++# in root projects we also want to build/run tests...
++if(PROJECT_IS_TOP_LEVEL)
++
++ # C tests
++ add_executable(test-internals test-internals.c dict-src.h dict-crc.h
zxcvbn.h)
++ target_include_directories(test-internals PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
++ target_link_libraries(test-internals PUBLIC ${LIBM})
++
++ add_executable(test-file test.c zxcvbn.c dict-src.h dict-crc.h
zxcvbn.h)
++ target_compile_definitions(test-file PRIVATE USE_DICT_FILE)
++ target_include_directories(test-file PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
++ target_link_libraries(test-file PUBLIC ${LIBM})
++
++ add_executable(test-inline test.c zxcvbn.c dict-src.h dict-crc.h
zxcvbn.h)
++ target_include_directories(test-inline PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
++ target_link_libraries(test-inline PUBLIC ${LIBM})
++
++ # C++ tests
++ file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/zxcvbn.c
${CMAKE_CURRENT_BINARY_DIR}/zxcvbn.cpp SYMBOLIC)
++ file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/test.c
${CMAKE_CURRENT_BINARY_DIR}/test.cpp SYMBOLIC)
++
++ add_executable(test-c++file ${CMAKE_CURRENT_BINARY_DIR}/test.cpp
${CMAKE_CURRENT_BINARY_DIR}/zxcvbn.cpp dict-src.h dict-crc.h zxcvbn.h)
++ target_compile_definitions(test-c++file PRIVATE USE_DICT_FILE)
++ target_include_directories(test-c++file PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
++ target_link_libraries(test-c++file PUBLIC ${LIBM})
++
++ add_executable(test-c++inline ${CMAKE_CURRENT_BINARY_DIR}/test.cpp
${CMAKE_CURRENT_BINARY_DIR}/zxcvbn.cpp dict-src.h dict-crc.h zxcvbn.h)
++ target_include_directories(test-c++inline PRIVATE
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
++ target_link_libraries(test-c++inline PUBLIC ${LIBM})
++
++ # libraries tests
++ add_executable(test-shlib test.c)
++ target_link_libraries(test-shlib zxcvbn-shared)
++
++ add_executable(test-statlib test.c)
++ target_link_libraries(test-statlib zxcvbn-static)
++
++ # test target
++ add_custom_target(test COMMAND test-internals COMMAND test-file
COMMAND test-inline COMMAND test-c++inline COMMAND test-c++file COMMAND
test-shlib COMMAND test-statlib DEPENDS testcases.txt)
++endif()
+--
+2.47.1
+
diff --git
a/libs/zxcvbn-c/patches/0002-Changed-the-compiler-warning-option-to-stop-warning-.patch

b/libs/zxcvbn-c/patches/0002-Changed-the-compiler-warning-option-to-stop-warning-.patch
new file mode 100644
index 0000000..8bf696a
--- /dev/null
+++
b/libs/zxcvbn-c/patches/0002-Changed-the-compiler-warning-option-to-stop-warning-.patch
@@ -0,0 +1,28 @@
+From 271f4f68f5970cb9ca0aa90d2a096edb9d34630c Mon Sep 17 00:00:00 2001
+From: tony <tsyrogit AT users.noreply.github.com>
+Date: Fri, 11 Aug 2023 22:28:15 +0100
+Subject: [PATCH 2/3] Changed the compiler warning option to stop warning
about
+ invalid option for c++ files. Occurred when using cmake and gcc version
12.3.
+
+Upstream-Status: Backport
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9cf0ef78d329..78d2cd8dce03 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,7 +6,7 @@ add_executable(dictgen dict-generate.cpp)
+ target_compile_features(dictgen PUBLIC cxx_std_11)
+ target_compile_options(dictgen PRIVATE "-O3")
+
+-add_compile_options("-Wextra" "-Wdeclaration-after-statement")
++add_compile_options("-Wall" "-Wextra")
+
+ find_library(LIBM m)
+
+--
+2.47.1
+
diff --git a/libs/zxcvbn-c/patches/0003-Add-CMake-installation-rules.patch
b/libs/zxcvbn-c/patches/0003-Add-CMake-installation-rules.patch
new file mode 100644
index 0000000..da3a9d3
--- /dev/null
+++ b/libs/zxcvbn-c/patches/0003-Add-CMake-installation-rules.patch
@@ -0,0 +1,25 @@
+From fea35625329d3184c5523ecf11597499a0c0fe9b Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT iodev.co.uk>
+Date: Thu, 23 Jan 2025 00:46:35 +0100
+Subject: [PATCH 3/3] Add CMake installation rules
+
+Upstream-Status: Pending
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ CMakeLists.txt | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 78d2cd8dce03..5ab8b92d379d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -77,3 +77,6 @@ if(PROJECT_IS_TOP_LEVEL)
+ # test target
+ add_custom_target(test COMMAND test-internals COMMAND test-file
COMMAND test-inline COMMAND test-c++inline COMMAND test-c++file COMMAND
test-shlib COMMAND test-statlib DEPENDS testcases.txt)
+ endif()
++
++install(TARGETS zxcvbn-shared zxcvbn-static DESTINATION lib)
++install(FILES zxcvbn.h DESTINATION include)
+--
+2.47.1
+


  • [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (3bb529d415396aa89a2e81d3380366c8a77df354), Ismael Luceno, 01/25/2025

Archive powered by MHonArc 2.6.24.

Top of Page