X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2FsslUtil.cpp;h=c7944f298bed9765993183a987589bc9beb1f105;hb=a14002d5a4531462c0ae6631323dd038e8d9990e;hp=db50f2d46918600e1a645b09aeb2588ef47ac948;hpb=c3f5775ce88f4df732e5e803dab70ce395c5f504;p=cassiopeia.git diff --git a/src/sslUtil.cpp b/src/sslUtil.cpp index db50f2d..c7944f2 100644 --- a/src/sslUtil.cpp +++ b/src/sslUtil.cpp @@ -159,8 +159,8 @@ void setupSerial( FILE* f ) { } } -std::shared_ptr openSerial( const char* name ) { - FILE* f = fopen( name, "r+" ); +std::shared_ptr openSerial( const std::string name ) { + FILE* f = fopen( name.c_str(), "r+" ); if( !f ) { std::cout << "Opening serial device failed" << std::endl; @@ -172,3 +172,9 @@ std::shared_ptr openSerial( const char* name ) { std::shared_ptr b( BIO_new_fd( fileno( f ), 0 ), BIO_free ); return b; } + +CAConfig::CAConfig( std::string path ) { + this->path = path; + ca = loadX509FromFile( path + "/ca.crt" ); + caKey = loadPkeyFromFile( path + "/ca.key" ); +}