Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pppd/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ static inline int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, long tls_ver_max)
*/
static int tls_verify_callback(int ok, X509_STORE_CTX *ctx)
{
char subject[256];
char cn_str[256];
char subject[256] = {0};
char cn_str[256] = {0};
X509 *peer_cert;
int err, depth;
SSL *ssl;
Expand Down Expand Up @@ -194,6 +194,11 @@ static int tls_verify_callback(int ok, X509_STORE_CTX *ctx)
}
}

if (ptr2 == NULL) {
error("Certificate verification error: unknown tls-verify-method: %s", tls_verify_method);
return 0;
}

if (strcmp(ptr1, ptr2)) {
error("Certificate verification error: CN (%s) != %s", ptr1, ptr2);
return 0;
Expand Down
Loading