summaryrefslogtreecommitdiffstats
path: root/Sluift
diff options
context:
space:
mode:
authorGurmeen Bindra <gurmeen.bindra@isode.com>2015-11-11 15:42:00 (GMT)
committerSwift Review <review@swift.im>2015-11-11 18:01:58 (GMT)
commiteb2cdc07f275d565b76940396381784e29125981 (patch)
tree242cc82f112aeb53819e7953c5d76ccde4b06bcb /Sluift
parentbd999e960a04721a81017161dae21fcd8d5e2ab6 (diff)
downloadswift-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.cpp6
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;
}