diff options
author | Martin Willi <martin@revosec.ch> | 2015-04-09 10:02:24 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2015-04-15 14:37:38 +0200 |
commit | 3941545fb90e9a53bdf077ddbb90157ce8747642 (patch) | |
tree | 1c4d9152044a4f65a79d0a23fba3df2be49ee09b /src/libstrongswan/crypto/diffie_hellman.h | |
parent | 5331584cc4ffcb058281236914bd65d27d4c3d7f (diff) | |
download | strongswan-3941545fb90e9a53bdf077ddbb90157ce8747642.tar.bz2 strongswan-3941545fb90e9a53bdf077ddbb90157ce8747642.tar.xz |
diffie-hellman: Introduce an optional setter for the private value
This allows us to work with deterministic values for testing purposes.
Diffstat (limited to 'src/libstrongswan/crypto/diffie_hellman.h')
-rw-r--r-- | src/libstrongswan/crypto/diffie_hellman.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstrongswan/crypto/diffie_hellman.h b/src/libstrongswan/crypto/diffie_hellman.h index 4704cd0da..abebd66ad 100644 --- a/src/libstrongswan/crypto/diffie_hellman.h +++ b/src/libstrongswan/crypto/diffie_hellman.h @@ -117,6 +117,18 @@ struct diffie_hellman_t { __attribute__((warn_unused_result)); /** + * Set an explicit own private value to use. + * + * Calling this method is usually not required, as the DH backend generates + * an appropriate private value itself. It is optional to implement, and + * used mostly for testing purposes. + * + * @param value private value to set + */ + bool (*set_private_value)(diffie_hellman_t *this, chunk_t value) + __attribute__((warn_unused_result)); + + /** * Get the DH group used. * * @return DH group set in construction |