MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / serverSessionKey

Method serverSessionKey

src/auth/SecureRemotePassword/srp.cpp:161–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void RemotePassword::serverSessionKey(UCharBuffer& sessionKey, const char* clientPubKey,
162 const UCharBuffer& verifier)
163{
164 clientPublicKey = BigInteger(clientPubKey);
165 computeScramble();
166 dumpIt("scramble", scramble);
167 BigInteger v = BigInteger(verifier);
168 BigInteger vu = v.modPow(scramble, group->prime); // v^u
169 BigInteger Avu = (clientPublicKey * vu) % group->prime; // Av^u
170 dumpIt("Avu", Avu);
171 BigInteger sessionSecret = Avu.modPow(privateKey, group->prime); // (Av^u) ^ b
172 dumpIt("serverPrivateKey", privateKey);
173 dumpIt("sessionSecret", sessionSecret);
174
175 hash.reset();
176 hash.processStrippedInt(sessionSecret);
177 hash.getHash(sessionKey);
178}
179
180// H(H(prime) ^ H(g), H(I), s, A, B, K)
181BigInteger RemotePassword::clientProof(const char* account, const char* salt, const UCharBuffer& sessionKey)

Callers 2

runTestFunction · 0.80
authenticateMethod · 0.80

Calls 6

BigIntegerClass · 0.85
modPowMethod · 0.80
processStrippedIntMethod · 0.80
dumpItFunction · 0.70
resetMethod · 0.45
getHashMethod · 0.45

Tested by 1

runTestFunction · 0.64