summaryrefslogtreecommitdiff
path: root/lib/lib5.c
diff options
context:
space:
mode:
authorBenedict <benedict@0xb8000.de>2016-12-09 18:35:45 +0100
committerBenedict <benedict@0xb8000.de>2017-02-21 13:00:26 +0100
commit6619623d75b8ace7f70f64dc683c5e9193aa6aea (patch)
tree7097aa916d060827a781f4839a3c78516e99f82b /lib/lib5.c
parent601bcda4cb9aaba2bd08810a46120a3d4c6b50d0 (diff)
set5: task37: completed
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;