From 0b2a439e7edb25a4f32d94ad652a2cd4f9b1533c Mon Sep 17 00:00:00 2001 From: David Keeler Date: Wed, 14 Jun 2017 15:10:28 -0700 Subject: [PATCH] bug 1373068 - fix the ctypes declaration of SSL_ClearSessionCache in head_psm.js r=Cykesiopka SSL_ClearSessionCache is `void SSL_ClearSessionCache()`. In head_psm.js it was being declared as `SECStatus SSL_ClearSessionCache()` and the "return value" was being checked, which was incorrect. This apparently wasn't causing failures on any of our test runs, but with tsan enabled the check would fail. MozReview-Commit-ID: 6KosOVPu8K4 --HG-- extra : rebase_source : 73addb80a5ab5263a182207a0f4277daf8ae32a5 --- security/manager/ssl/tests/unit/head_psm.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/security/manager/ssl/tests/unit/head_psm.js b/security/manager/ssl/tests/unit/head_psm.js index 10881e9ef78d..e9536088e774 100644 --- a/security/manager/ssl/tests/unit/head_psm.js +++ b/security/manager/ssl/tests/unit/head_psm.js @@ -238,15 +238,18 @@ function clearSessionCache() { let SSL_ClearSessionCache = null; try { SSL_ClearSessionCache = - _getLibraryFunctionWithNoArguments("SSL_ClearSessionCache", "ssl3"); + _getLibraryFunctionWithNoArguments("SSL_ClearSessionCache", "ssl3", + ctypes.void_t); } catch (e) { // On Windows, this is actually in the nss3 library. SSL_ClearSessionCache = - _getLibraryFunctionWithNoArguments("SSL_ClearSessionCache", "nss3"); + _getLibraryFunctionWithNoArguments("SSL_ClearSessionCache", "nss3", + ctypes.void_t); } - if (!SSL_ClearSessionCache || SSL_ClearSessionCache() != 0) { - throw new Error("Failed to clear SSL session cache"); + if (!SSL_ClearSessionCache) { + throw new Error("couldn't get SSL_ClearSessionCache"); } + SSL_ClearSessionCache(); } function getSSLStatistics() {