diff options
| author | Benedict <benedict@0xb8000.de> | 2016-12-09 18:35:45 +0100 |
|---|---|---|
| committer | Benedict <benedict@0xb8000.de> | 2017-02-21 13:00:26 +0100 |
| commit | 6619623d75b8ace7f70f64dc683c5e9193aa6aea (patch) | |
| tree | 7097aa916d060827a781f4839a3c78516e99f82b /lib/lib5.c | |
| parent | 601bcda4cb9aaba2bd08810a46120a3d4c6b50d0 (diff) | |
set5: task37: completed
Diffstat (limited to 'lib/lib5.c')
| -rw-r--r-- | lib/lib5.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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; |
