diff options
author | Gurmeen Bindra <gurmeen.bindra@isode.com> | 2015-11-11 15:42:00 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2015-11-11 18:01:58 (GMT) |
commit | eb2cdc07f275d565b76940396381784e29125981 (patch) | |
tree | 242cc82f112aeb53819e7953c5d76ccde4b06bcb /Sluift | |
parent | bd999e960a04721a81017161dae21fcd8d5e2ab6 (diff) | |
download | swift-eb2cdc07f275d565b76940396381784e29125981.zip swift-eb2cdc07f275d565b76940396381784e29125981.tar.bz2 |
Fix sluift API for clearing certificate
Before this patch it was calling the constructor and creating certificate
object with empty string. This was causing tests to fail when client was
set with null certificate.
This object fixes it by setting the certificate object to Null if the
certificate file is empty.
Test-information:
Test cases using sluift with this API that set null certificate now pass
Change-Id: Id75e22b58afebb2db463a7a23a4ca0686ef6eb12
Diffstat (limited to 'Sluift')
-rw-r--r-- | Sluift/client.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Sluift/client.cpp b/Sluift/client.cpp index 813c180..997fd00 100644 --- a/Sluift/client.cpp +++ b/Sluift/client.cpp @@ -751,7 +751,11 @@ SLUIFT_LUA_FUNCTION_WITH_HELP( ++index; } } - getClient(L)->getClient()->setCertificate(boost::make_shared<PKCS12Certificate>(file, createSafeByteArray(pwd))); + if (file.empty()) { + getClient(L)->getClient()->setCertificate(CertificateWithKey::ref()); + } else { + getClient(L)->getClient()->setCertificate(boost::make_shared<PKCS12Certificate>(file, createSafeByteArray(pwd))); + } return 0; } |