Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed Jan 16, 2025
1 parent 9cb41b0 commit 69d176c
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/crypto/crypto_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,29 +229,6 @@ unsigned long LoadCertsFromFile( // NOLINT(runtime/int)

enum TrustStatus { UNSPECIFIED, TRUSTED, DISTRUSTED };

std::string getX509Name(X509_NAME* x509_name) {
ClearErrorOnReturn clearErrorOnReturn;
if (x509_name == nullptr) return {};

BIO* bio = BIO_new(BIO_s_mem());
if (bio == nullptr) {
return nullptr;
}

if (X509_NAME_print_ex(
bio, x509_name, 0, XN_FLAG_ONELINE) <= 0) {
return {};
}

const int resultLen = BIO_pending(bio);
char* issuer = reinterpret_cast<char *>(calloc(resultLen + 1, 1));
BIO_read(bio, issuer, resultLen);
BIO_free_all(bio);

std::string strResult = issuer;
return strResult;
}

char* bioToCString(BIOPointer* bio) {
const int len = BIO_pending(bio->get());
char* result = reinterpret_cast<char *>(calloc(len + 1, 1));
Expand Down

0 comments on commit 69d176c

Please sign in to comment.