File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -4231,6 +4231,28 @@ static int test_cipher_with_engine(void)
4231
4231
# endif /* OPENSSL_NO_DYNAMIC_ENGINE */
4232
4232
#endif /* OPENSSL_NO_DEPRECATED_3_0 */
4233
4233
4234
+ static int ecxnids [] = {
4235
+ NID_X25519 ,
4236
+ NID_X448 ,
4237
+ NID_ED25519 ,
4238
+ NID_ED448
4239
+ };
4240
+
4241
+ /* Test that creating ECX keys with a short private key fails as expected */
4242
+ static int test_ecx_short_keys (int tst )
4243
+ {
4244
+ unsigned char ecxkeydata = 1 ;
4245
+ EVP_PKEY * pkey ;
4246
+
4247
+
4248
+ pkey = EVP_PKEY_new_raw_private_key (ecxnids [tst ], NULL , & ecxkeydata , 1 );
4249
+ if (!TEST_ptr_null (pkey )) {
4250
+ EVP_PKEY_free (pkey );
4251
+ return 0 ;
4252
+ }
4253
+ return 1 ;
4254
+ }
4255
+
4234
4256
typedef enum OPTION_choice {
4235
4257
OPT_ERR = -1 ,
4236
4258
OPT_EOF = 0 ,
@@ -4374,6 +4396,8 @@ int setup_tests(void)
4374
4396
# endif
4375
4397
#endif
4376
4398
4399
+ ADD_ALL_TESTS (test_ecx_short_keys , OSSL_NELEM (ecxnids ));
4400
+
4377
4401
return 1 ;
4378
4402
}
4379
4403
You can’t perform that action at this time.
0 commit comments