diff --git a/bsspeke.c b/bsspeke.c index bbb393dba36c0118cb17b21fc11029c9e8078bc4..3d19f4c33e014c233bd0ff0cbea747582c95ce45 100644 --- a/bsspeke.c +++ b/bsspeke.c @@ -309,72 +309,6 @@ bsspeke_client_verify_message4(const bsspeke_msg4_t *msg4, int main(int argc, char *argv[]) { - // Before execution of the protocol - // Both have: - // idS = server identity - char *server_id; - // Client has: - // idC = client identity - char *client_id; - char *password; - // Server has these for "idC": - // salt - // settings - // P = hashToPoint(p) - // V = v * P - uint8_t salt[32]; - uint8_t P[32]; // curve point - uint8_t V[32]; // curve point - - - // Step 1: Client hashes password, maps to a point on the curve, blinds with a random value - // C: r = random() - // C: R = r * hashToPoint(H(password, idC, idS)) - // C->S: idC, R - uint8_t r[32]; // scalar - uint8_t R[32]; // curve point - - - // Step 2: Server generates response with blind salt - // S: b = random() - // S: B = b * P - // S: R' = H(salt) * R - // C<-S: B, R', settings - uint8_t b[32]; // scalar - uint8_t B[32]; // curve point - uint8_t R_prime[32]; // curve point - - // Step 3: - // C: BlindSalt = (1/r) * R' - // C: p || v = pwKdf(password, BlindSalt, idC, idS, settings) - // C: P = hashToPoint(p) - // C: a = random() - // C: A = a * P - // C: K_c = H(idC, idS, A, B, a * B, v * B) - // C: verifierC = H(K_c, verifyCModifier) - // C->S: A, verifierC[, encryptedDataC] - uint8_t blind_salt[32]; // curve point - uint8_t password_hash[64]; // hash - uint8_t client_P[32]; // curve point - uint8_t a[32]; // scalar - uint8_t A[32]; // curve point - uint8_t K_c[32]; // hash - uint8_t verifierC[32]; // hash - - - // Step 4: - // S: K_s = H(idC, idS, A, B, b * A, b * V) - // S: Checks verifierC == H(K_s, verifyCModifier) - // S: verifierS = H(K_s, verifySModifier) - // C<-S: verifierS[, encryptedDataS] - uint8_t K_s[32]; // hash - uint8_t server_hash[32]; // hash -- should match verifierC - - - // Step 5: - // C: Checks verifierS == H(K_c, verifySModifier) - uint8_t client_hash[32]; // hash -- should match verifierS - return 0; }