support new Op0enSSL 1.1.0 API
This commit is contained in:
@@ -21,17 +21,31 @@ class TestEngine: virtual public openssl::Engine {
|
||||
CRYPTOLOG("log");
|
||||
return "TestEngine_NAME";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class OtherTestEngine: virtual public openssl::Engine {
|
||||
|
||||
public:
|
||||
|
||||
virtual const char* id() {
|
||||
CRYPTOLOG("log");
|
||||
return "OtherTestEngine_ID";
|
||||
}
|
||||
virtual const char* name() {
|
||||
CRYPTOLOG("log");
|
||||
return "OtherTestEngine_NAME";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(int, char**) {
|
||||
{
|
||||
openssl::RegisterEngine<> testEngine(new TestEngine);
|
||||
openssl::RegisterEngine<> testEngine(new TestEngine);
|
||||
openssl::RegisterEngine<> otherTestEngine(new OtherTestEngine);
|
||||
|
||||
for (ENGINE* e(ENGINE_get_first()); e; e = ENGINE_get_next(e)) {
|
||||
std::cout<<"Found Engine: "<<ENGINE_get_id(e)<<std::endl;
|
||||
}
|
||||
for (openssl::Engine::iterator it; it; ++it) {
|
||||
std::cout<<"Found Engine: "<<(*it).id()<<std::endl;
|
||||
}
|
||||
|
||||
ENGINE_cleanup();
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user