Skip to content
Snippets Groups Projects
Commit 98aa5be3 authored by deuce's avatar deuce
Browse files

add_public_key() takes a public key, not a private one.

parent 07e23d4e
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,6 @@
#include "js_cryptcert.h"
#include "ssl.h"
static JSClass js_cryptcert_class;
static const char* getprivate_failure = "line %d %s %s JS_GetPrivate failed";
// Helpers
......@@ -2564,7 +2563,7 @@ static JSBool js_cryptcert_enumerate(JSContext *cx, JSObject *obj)
return(js_cryptcert_resolve(cx, obj, JSID_VOID));
}
static JSClass js_cryptcert_class = {
JSClass js_cryptcert_class = {
"CryptCert" /* name */
,JSCLASS_HAS_PRIVATE /* flags */
,JS_PropertyStub /* addProperty */
......
......@@ -5,6 +5,8 @@ struct js_cryptcert_private_data {
CRYPT_CERTIFICATE cert;
};
extern JSClass js_cryptcert_class;
JSObject* DLLCALL js_CreateCryptCertObject(JSContext* cx, CRYPT_CERTIFICATE cert);
#endif
......@@ -114,8 +114,8 @@ js_add_public_key(JSContext *cx, uintN argc, jsval *arglist)
return JS_FALSE;
}
cert = JSVAL_TO_OBJECT(argv[0]);
if (!JS_InstanceOf(cx, cert, &js_cryptcon_class, NULL)) {
JS_ReportError(cx, "Invalid CryptContext");
if (!JS_InstanceOf(cx, cert, &js_cryptcert_class, NULL)) {
JS_ReportError(cx, "Invalid CryptCert");
return JS_FALSE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment