]>
git.ipfire.org Git - thirdparty/openssl.git/blob - crypto/engine/tb_eckey.c
2 * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include "eng_local.h"
12 static ENGINE_TABLE
*dh_table
= NULL
;
13 static const int dummy_nid
= 1;
15 void ENGINE_unregister_EC(ENGINE
*e
)
17 engine_table_unregister(&dh_table
, e
);
20 static void engine_unregister_all_EC(void)
22 engine_table_cleanup(&dh_table
);
25 int ENGINE_register_EC(ENGINE
*e
)
27 if (e
->ec_meth
!= NULL
)
28 return engine_table_register(&dh_table
,
29 engine_unregister_all_EC
, e
, &dummy_nid
,
34 void ENGINE_register_all_EC(void)
38 for (e
= ENGINE_get_first(); e
; e
= ENGINE_get_next(e
))
39 ENGINE_register_EC(e
);
42 int ENGINE_set_default_EC(ENGINE
*e
)
44 if (e
->ec_meth
!= NULL
)
45 return engine_table_register(&dh_table
,
46 engine_unregister_all_EC
, e
, &dummy_nid
,
52 * Exposed API function to get a functional reference from the implementation
53 * table (ie. try to get a functional reference from the tabled structural
56 ENGINE
*ENGINE_get_default_EC(void)
58 return engine_table_select(&dh_table
, dummy_nid
);
61 /* Obtains an EC_KEY implementation from an ENGINE functional reference */
62 const EC_KEY_METHOD
*ENGINE_get_EC(const ENGINE
*e
)
67 /* Sets an EC_KEY implementation in an ENGINE structure */
68 int ENGINE_set_EC(ENGINE
*e
, const EC_KEY_METHOD
*ec_meth
)