diff options
author | lloyd <[email protected]> | 2012-01-26 18:14:23 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-01-26 18:14:23 +0000 |
commit | 91b5bfa75c928510c8fc3e001120a3bb894dbb1d (patch) | |
tree | 4d0f2d875f9dd3582bc984f6c8f6a71c76494281 /src/credentials | |
parent | 8d06088541fbdc8a70c52a32aaa18cb02b61c44b (diff) |
Deleting the return of private_key_for in the TLS server forces the
credentials server to return a new copy each time which is slow and
mostly pointless. Instead, specify that the key remains owned by the
credentials manager.
This is theoretically an issue if you have thousands of keys to
manage; the credentials server doesn't actually know when they have
gone out of scope until its destructor runs. So it could be forced to
use a lot of memory in the meantime. I'm not sure that this is a case
worth optimizing for, at least until someone comes along who actually
has this as a problem.
Diffstat (limited to 'src/credentials')
-rw-r--r-- | src/credentials/credentials_manager.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/credentials/credentials_manager.h b/src/credentials/credentials_manager.h index 5972dc2d4..19721715d 100644 --- a/src/credentials/credentials_manager.h +++ b/src/credentials/credentials_manager.h @@ -113,6 +113,8 @@ class BOTAN_DLL Credentials_Manager /** * @return private key associated with this certificate if we should * use it with this context. cert was returned by cert_chain + * @note this object should retain ownership of the returned key; + * it should not be deleted by the caller. */ virtual Private_Key* private_key_for(const X509_Certificate& cert, const std::string& type, |