Skip to content

JS CryptKeyset() constructor crashes (throws exception) on Windows

100% reproducible, just running this one line of JS: CryptKeyset(system.temp_dir + "tmpkeyset", CryptKeyset.KEYOPT.CREATE)

Backtrace:

>	cl32.dll!sFileOpen(ST * stream, const char * fileName, const int mode) Line 5690	C
 	cl32.dll!openKeysetStream(ST * stream, const char * name, const int nameLength, const CRYPT_KEYOPT_TYPE options, int * isReadOnly, KEYSET_SUBTYPE * keysetSubType) Line 696	C
 	cl32.dll!openKeyset(int * iCryptKeyset, const int iCryptOwner, const CRYPT_KEYSET_TYPE keysetType, const char * name, const int nameLength, const CRYPT_KEYOPT_TYPE options, KI * * keysetInfoPtrPtr) Line 1626	C
 	cl32.dll!createKeyset(MESSAGE_CREATEOBJECT_INFO * createInfo, const void * auxDataPtr, const int auxValue) Line 1830	C
 	[Inline Frame] cl32.dll!createObject(DI *) Line 758	C
 	cl32.dll!deviceMessageFunction(void * objectInfoPtr, const MESSAGE_TYPE message, void * messageDataPtr, const int messageValue) Line 1102	C
 	cl32.dll!dispatchMessage(const int localObjectHandle, const MESSAGE_QUEUE_DATA * messageQueueData, OBJECT_INFO * objectInfoPtr, const void * aclPtr) Line 1720	C
 	cl32.dll!krnlSendMessage(const int objectHandle, const MESSAGE_TYPE message, void * messageDataPtr, const int messageValue) Line 2111	C
 	cl32.dll!cmdCreateObject(COMMAND_INFO * cmd) Line 254	C
 	cl32.dll!cryptKeysetOpen(int * keyset, const int cryptUser, const CRYPT_KEYSET_TYPE keysetType, const char * name, const CRYPT_KEYOPT_TYPE options) Line 2313	C
 	sbbs.dll!js_cryptkeyset_constructor(JSContext * cx, unsigned int argc, unsigned __int64 * arglist) Line 479	C
 	[External Code]	
 	[Frames below may be incorrect and/or missing, no symbols loaded for mozjs185-1.0.dll]