@@ -3242,22 +3242,22 @@ qjs_webcrypto_import_key(JSContext *cx, JSValueConst this_val, int argc,
3242
3242
case QJS_KEY_FORMAT_PKCS8 :
3243
3243
bio = BIO_new_mem_buf (key_data .start , key_data .length );
3244
3244
if (bio == NULL ) {
3245
- JS_ThrowTypeError (cx , "BIO_new_mem_buf() failed" );
3245
+ qjs_webcrypto_error (cx , "BIO_new_mem_buf() failed" );
3246
3246
goto fail ;
3247
3247
}
3248
3248
3249
3249
pkcs8 = d2i_PKCS8_PRIV_KEY_INFO_bio (bio , NULL );
3250
3250
if (pkcs8 == NULL ) {
3251
3251
BIO_free (bio );
3252
- JS_ThrowTypeError (cx , "d2i_PKCS8_PRIV_KEY_INFO_bio() failed" );
3252
+ qjs_webcrypto_error (cx , "d2i_PKCS8_PRIV_KEY_INFO_bio() failed" );
3253
3253
goto fail ;
3254
3254
}
3255
3255
3256
3256
pkey = EVP_PKCS82PKEY (pkcs8 );
3257
3257
if (pkey == NULL ) {
3258
3258
PKCS8_PRIV_KEY_INFO_free (pkcs8 );
3259
3259
BIO_free (bio );
3260
- JS_ThrowTypeError (cx , "EVP_PKCS82PKEY() failed" );
3260
+ qjs_webcrypto_error (cx , "EVP_PKCS82PKEY() failed" );
3261
3261
goto fail ;
3262
3262
}
3263
3263
@@ -3272,7 +3272,7 @@ qjs_webcrypto_import_key(JSContext *cx, JSValueConst this_val, int argc,
3272
3272
start = key_data .start ;
3273
3273
pkey = d2i_PUBKEY (NULL , & start , key_data .length );
3274
3274
if (pkey == NULL ) {
3275
- JS_ThrowTypeError (cx , "d2i_PUBKEY() failed" );
3275
+ qjs_webcrypto_error (cx , "d2i_PUBKEY() failed" );
3276
3276
goto fail ;
3277
3277
}
3278
3278
@@ -3720,7 +3720,7 @@ qjs_convert_p1363_to_der(JSContext *cx, EVP_PKEY *pkey, u_char *p1363,
3720
3720
3721
3721
if (len < 0 ) {
3722
3722
js_free (cx , data );
3723
- JS_ThrowTypeError (cx , "i2d_ECDSA_SIG() failed" );
3723
+ qjs_webcrypto_error (cx , "i2d_ECDSA_SIG() failed" );
3724
3724
goto fail ;
3725
3725
}
3726
3726
0 commit comments