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 @@ -341,3 +341,27 @@ pub unsafe fn EVP_PKEY_assign_DH(pkey: *mut EVP_PKEY, dh: *mut DH) -> c_int {
341
341
pub unsafe fn EVP_PKEY_assign_EC_KEY ( pkey : * mut EVP_PKEY , ec_key : * mut EC_KEY ) -> c_int {
342
342
EVP_PKEY_assign ( pkey, EVP_PKEY_EC , ec_key as * mut c_void )
343
343
}
344
+
345
+ cfg_if ! {
346
+ if #[ cfg( ossl300) ] {
347
+ // consts required for EVP_PKEY_fromdata selection value
348
+
349
+ // From <openssl/core_dispatch.h>
350
+ const OSSL_KEYMGMT_SELECT_PRIVATE_KEY : c_int = 0x01 ;
351
+ const OSSL_KEYMGMT_SELECT_PUBLIC_KEY : c_int = 0x02 ;
352
+ const OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS : c_int = 0x04 ;
353
+ const OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS : c_int = 0x80 ;
354
+ const OSSL_KEYMGMT_SELECT_ALL_PARAMETERS : c_int =
355
+ OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS | OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS ;
356
+ const OSSL_KEYMGMT_SELECT_KEYPAIR : c_int =
357
+ OSSL_KEYMGMT_SELECT_PRIVATE_KEY | OSSL_KEYMGMT_SELECT_PUBLIC_KEY ;
358
+ const OSSL_KEYMGMT_SELECT_ALL : c_int =
359
+ OSSL_KEYMGMT_SELECT_KEYPAIR | OSSL_KEYMGMT_SELECT_ALL_PARAMETERS ;
360
+
361
+ // From <openssl/evp.h>
362
+ pub const EVP_PKEY_KEY_PARAMETERS : c_int = OSSL_KEYMGMT_SELECT_ALL_PARAMETERS ;
363
+ pub const EVP_PKEY_PRIVATE_KEY : c_int = EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PRIVATE_KEY ;
364
+ pub const EVP_PKEY_PUBLIC_KEY : c_int = EVP_PKEY_KEY_PARAMETERS | OSSL_KEYMGMT_SELECT_PUBLIC_KEY ;
365
+ pub const EVP_PKEY_KEYPAIR : c_int = EVP_PKEY_PUBLIC_KEY | OSSL_KEYMGMT_SELECT_PRIVATE_KEY ;
366
+ }
367
+ }
You can’t perform that action at this time.
0 commit comments