support new Op0enSSL 1.1.0 API

This commit is contained in:
Marc Wäckerlin
2018-03-12 13:34:44 +00:00
parent 1f7fac1dbc
commit 8e7084e733
12 changed files with 962 additions and 140 deletions

View File

@@ -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;
}