@@ -88,18 +88,21 @@ test('rsa_public.pem', 'rsa_private.pem', 'sha256', false,
88
88
89
89
// ED25519
90
90
test ( 'ed25519_public.pem' , 'ed25519_private.pem' , undefined , true ) ;
91
- // ED448
92
- test ( 'ed448_public.pem' , 'ed448_private.pem' , undefined , true ) ;
93
91
94
- // ECDSA w/ der signature encoding
95
- test ( 'ec_secp256k1_public.pem' , 'ec_secp256k1_private.pem' , 'sha384' ,
96
- false ) ;
97
- test ( 'ec_secp256k1_public.pem' , 'ec_secp256k1_private.pem' , 'sha384' ,
98
- false , { dsaEncoding : 'der' } ) ;
92
+ if ( ! process . features . openssl_is_boringssl ) {
93
+ // ED448
94
+ test ( 'ed448_public.pem' , 'ed448_private.pem' , undefined , true ) ;
99
95
100
- // ECDSA w/ ieee-p1363 signature encoding
101
- test ( 'ec_secp256k1_public.pem' , 'ec_secp256k1_private.pem' , 'sha384' , false ,
102
- { dsaEncoding : 'ieee-p1363' } ) ;
96
+ // ECDSA w/ der signature encoding
97
+ test ( 'ec_secp256k1_public.pem' , 'ec_secp256k1_private.pem' , 'sha384' ,
98
+ false ) ;
99
+ test ( 'ec_secp256k1_public.pem' , 'ec_secp256k1_private.pem' , 'sha384' ,
100
+ false , { dsaEncoding : 'der' } ) ;
101
+
102
+ // ECDSA w/ ieee-p1363 signature encoding
103
+ test ( 'ec_secp256k1_public.pem' , 'ec_secp256k1_private.pem' , 'sha384' , false ,
104
+ { dsaEncoding : 'ieee-p1363' } ) ;
105
+ }
103
106
104
107
// DSA w/ der signature encoding
105
108
test ( 'dsa_public.pem' , 'dsa_private.pem' , 'sha256' ,
@@ -150,7 +153,10 @@ MCowBQYDK2VuAyEA6pwGRbadNQAI/tYN8+/p/0/hbsdHfOEGr1ADiLVk/Gc=
150
153
const data = crypto . randomBytes ( 32 ) ;
151
154
const signature = crypto . randomBytes ( 16 ) ;
152
155
153
- const expected = hasOpenSSL3 ? / o p e r a t i o n n o t s u p p o r t e d f o r t h i s k e y t y p e / : / n o d e f a u l t d i g e s t / ;
156
+ let expected = / n o d e f a u l t d i g e s t / ;
157
+ if ( hasOpenSSL3 || ! process . features . openssl_is_boringssl ) {
158
+ expected = / o p e r a t i o n [ \s _ ] n o t [ \s _ ] s u p p o r t e d [ \s _ ] f o r [ \s _ ] t h i s [ \s _ ] k e y t y p e / i;
159
+ }
154
160
155
161
crypto . verify ( undefined , data , untrustedKey , signature , common . mustCall ( ( err ) => {
156
162
assert . ok ( err ) ;
@@ -164,6 +170,6 @@ MCowBQYDK2VuAyEA6pwGRbadNQAI/tYN8+/p/0/hbsdHfOEGr1ADiLVk/Gc=
164
170
} ) ;
165
171
crypto . sign ( 'sha512' , 'message' , privateKey , common . mustCall ( ( err ) => {
166
172
assert . ok ( err ) ;
167
- assert . match ( err . message , / d i g e s t t o o b i g f o r r s a k e y / ) ;
173
+ assert . match ( err . message , / d i g e s t [ \s _ ] t o o [ \s _ ] b i g [ \s _ ] f o r [ \s _ ] r s a [ \s _ ] k e y / i ) ;
168
174
} ) ) ;
169
175
}
0 commit comments