File 0653-crypto-fix-error-bit_size-1-by-byte_size-1.patch of Package erlang

From 37ef9be66c2b838b71819eb9254a2bda56092003 Mon Sep 17 00:00:00 2001
From: Kiko Fernandez-Reyes <kiko@erlang.org>
Date: Mon, 6 Feb 2023 08:51:03 +0100
Subject: [PATCH] crypto: fix error bit_size/1 by byte_size/1

This was a fix to the bug introduced in PR-6768
---
 lib/crypto/src/crypto.erl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index a61ccc87bc..54fb719a04 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -2276,9 +2276,9 @@ srp_pad_length(Width, Length) ->
     (Width - Length rem Width) rem Width.
 
 srp_pad_to(Width, Binary) ->
-    case srp_pad_length(Width, bit_size(Binary)) of
+    case srp_pad_length(Width, byte_size(Binary)) of
         0 -> Binary;
-        N -> << 0:N, Binary/binary>>
+        N -> << 0:N/unit:8, Binary/binary>>
     end.
 
 srp_host_secret_nif(_Verifier, _B, _U, _A, _Prime) -> ?nif_stub.
-- 
2.35.3

openSUSE Build Service is sponsored by