[botan-devel] Diffie-Hellman key exchange issue going to v1.10.0

William K. Foster wkf at alum.mit.edu
Fri Jun 24 12:13:26 EDT 2011


Hello,

I am doing DH key exchange and my code does not compile anymore in v1.10.0

Issue is disappeared member function derive_key:

void
CipherDH::exchangeSharedKey(const DH_PublicKey *serverPublicDHKey, string
&sharedKey)
{
  const DH_PrivateKey clientPrivateKey(rng(),
serverPublicDHKey->get_domain());
  const DH_PublicKey clientPublicKey = clientPrivateKey;
  const string clientPublicDHKey = PEM_encode(clientPublicKey);
  const size_t publicDHKeySize = clientPublicDHKey.size();
  const SymmetricKey sharedSymKey
    = clientPrivateKey.derive_key(*serverPublicDHKey);
...
}

The DH_PublicKey class no longer has derive_key(), what is its replacement
in v1.10.0 for DH key exchange?

Same issue also applies to class Botan::DH_PrivateKey no longer having
derive_key().

string
CipherDH::computeSharedKey(const DH_PublicKey *clientPublicDHKey)
{
  // Member variable is: const Botan::DH_PrivateKey _privateDHKey;
  //  init:  _privateDHKey(rng(), DL_Group("modp/ietf/1024"))

  const SymmetricKey sharedKey =
_privateDHKey.derive_key(*clientPublicDHKey);
...
}

Thanks.

-William



More information about the botan-devel mailing list