Bug 828730: Fix crash in test_signed_apps/generate.sh, r=bsmith, a=NPOTB
authorAntonio Manuel Amaya Calvo <amac@tid.es>
Thu, 10 Jan 2013 13:55:54 +0100
changeset 118410 9f1d90aba921ee9dd7aab50faf299f319070b135
parent 118409 d70c9eb65c754602fef64c8e64af95597e3ecb66
child 118411 4e1fe4baad60a7cf90b03cca3a91dc23aaf8d5c2
push id24166
push userMs2ger@gmail.com
push dateFri, 11 Jan 2013 13:57:41 +0000
treeherdermozilla-central@63c4b0f66a0c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmith, NPOTB
bugs828730
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 828730: Fix crash in test_signed_apps/generate.sh, r=bsmith, a=NPOTB
security/manager/ssl/tests/unit/test_signed_apps/nss_ctypes.py
--- a/security/manager/ssl/tests/unit/test_signed_apps/nss_ctypes.py
+++ b/security/manager/ssl/tests/unit/test_signed_apps/nss_ctypes.py
@@ -7,16 +7,17 @@ if sys.platform == 'darwin':
   libsuffix = ".dylib"
 elif os.name == 'posix':
   libprefix = "lib"
   libsuffix = ".so"
 else: # assume windows
   libprefix = ""
   libsuffix = ".dll"
 
+plc   = cdll.LoadLibrary(libprefix + "plc4"   + libsuffix)
 nspr  = cdll.LoadLibrary(libprefix + "nspr4"  + libsuffix)
 nss   = cdll.LoadLibrary(libprefix + "nss3"   + libsuffix)
 smime = cdll.LoadLibrary(libprefix + "smime3" + libsuffix)
 
 nspr.PR_GetError.argtypes = []
 nspr.PR_GetError.restype = c_int32
 nspr.PR_ErrorToName.argtypes = [c_int32]
 nspr.PR_ErrorToName.restype = c_char_p
@@ -59,17 +60,17 @@ def NSS_Shutdown():
 
 PK11PasswordFunc = CFUNCTYPE(c_char_p, c_void_p, PRBool, c_char_p)
 
 # pass the result of this as the wincx parameter when a wincx is required
 nss.PK11_SetPasswordFunc.argtypes = [PK11PasswordFunc]
 nss.PK11_SetPasswordFunc.restype = None
 def SetPasswordContext(password):
   def callback(slot, retry, arg):
-    return password
+    return plc.PL_strdup(password)
   wincx = PK11PasswordFunc(callback)
   nss.PK11_SetPasswordFunc(wincx)
   return wincx
 
 nss.CERT_GetDefaultCertDB.argtypes = []
 nss.CERT_GetDefaultCertDB.restype = c_void_p
 def CERT_GetDefaultCertDB():
   return raise_if_NULL(nss.CERT_GetDefaultCertDB())