Commit d0c72e6a0e1fe3998b94d4c475657c2d20d304b4

Thomas de Grivel 2024-10-25T16:48:43

crypt

diff --git a/.ikc3_history b/.ikc3_history
index b271fb3..4ff57e3 100644
--- a/.ikc3_history
+++ b/.ikc3_history
@@ -1,12 +1,3 @@
-type(10000000000000000000000000000000000000000000000000)
-type(1)
-type(255)
-type(256)
-quote fn (x) { x * x }
-quote if true do if false do 1 else fn (x) { x * x } end end
-quote if true do if false do 1 else fn (x) do x * x end end end
-quote if true do if false do %KC3.Operator{sym: :-, symbol_value: 3} else fn (x) do x * x end end end
-if true do if true do %KC3.Operator{sym: :-, symbol_value: 3} else fn (x) do x * x end end end
 type(0)
 type(-1)
 def operator_muul = %KC3.Operator{sym: :****, symbol_value: fn (a, b) { a * a + b * b }
@@ -97,3 +88,12 @@ Map.put(%{}, :a, 1)
 Struct.put(%KC3.Operator{}, :sym, :plop)
 type(%KC3.Operator{})
 Struct.put(%KC3.Operator{}, :sym, :plop)
+Crypt.hash_password("Plop")
+hash = Crypt.hash_password("Plop")
+Crypt.check_password("Plop", hash)
+Crypt.check_password("plop", hash)
+hash = Crypt.hash_password("Plop")
+Crypt.check_password("plop", hash)
+hash = Crypt.hash_password("Plop")
+Crypt.check_password("plop", hash)
+Crypt.check_password("Plop", hash)
diff --git a/libkc3/crypt.c b/libkc3/crypt.c
index 20b77d3..53199a3 100644
--- a/libkc3/crypt.c
+++ b/libkc3/crypt.c
@@ -26,10 +26,12 @@ bool * crypt_check_password (const s_str *pass, const s_str *hash,
   assert(hash);
   assert(dest);
   if (crypt_checkpass(pass->ptr.pchar, hash->ptr.pchar)) {
-    e = errno;
-    err_write_1("crypt_check_password: ");
-    err_write_1(strerror(e));
-    err_write_1("\n");
+    if (errno != EACCES) {
+      e = errno;
+      err_write_1("crypt_check_password: ");
+      err_write_1(strerror(e));
+      err_write_1("\n");
+    }
     *dest = false;
   }
   else