summaryrefslogtreecommitdiff
path: root/lib/lib5.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lib5.c')
-rw-r--r--lib/lib5.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/lib5.c b/lib/lib5.c
index f637469..04c7806 100644
--- a/lib/lib5.c
+++ b/lib/lib5.c
@@ -265,6 +265,20 @@ void srp_compute_uH(struct srp_context *srpc)
BN_bin2bn(uH, 20, srpc->u);
}
+void srp_client_s_0_prepare_k(struct srp_context *srpc)
+{
+ SHA1Context sha1;
+ BIGNUM *S = BN_new();
+ BN_zero(S);
+
+ char *s_str = malloc(BN_num_bytes(S));
+ BN_bn2bin(S, s_str);
+ SHA1Reset(&sha1);
+ SHA1Input(&sha1, s_str, BN_num_bytes(S));
+ SHA1Result(&sha1);
+ memcpy(srpc->client_K, &(sha1.Message_Digest), 20);
+}
+
void srp_client_prepare_k(struct srp_context *srpc, char *password)
{
SHA1Context sha1;