Merge branch 'tmp-uninitialised-handle' into 'master'

Do not use uninitialised PAM/GnuTLS handles

Closes #722

See merge request openconnect/ocserv!547
This commit is contained in:
Nikos Mavrogiannopoulos
2026-05-17 19:56:55 +00:00
2 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ static int pam_acct_open_session(void *vctx, unsigned int auth_method,
pret = pam_start(PACKAGE, ai->username, &dc, &ph);
if (pret != PAM_SUCCESS) {
oc_syslog(LOG_NOTICE, "PAM-acct init: %s",
pam_strerror(ph, pret));
pam_strerror(NULL, pret));
goto fail1;
}
+8 -7
View File
@@ -160,13 +160,6 @@ static int ca_handler(worker_st *ws, unsigned int http_ver, unsigned int der)
return -1;
}
ret = gnutls_x509_crt_init(&issuer);
if (ret < 0) {
oclog(ws, LOG_DEBUG, "could not initialize cert");
ret = -1;
goto cleanup;
}
ret = gnutls_x509_crt_import(crt, &certs[0],
GNUTLS_X509_FMT_DER);
if (ret < 0) {
@@ -182,6 +175,14 @@ static int ca_handler(worker_st *ws, unsigned int http_ver, unsigned int der)
goto cleanup;
}
ret = gnutls_x509_crt_init(&issuer);
if (ret < 0) {
ret = -1;
oclog(ws, LOG_DEBUG,
"could not initialize issuer cert");
goto cleanup;
}
ret = gnutls_x509_crt_import(issuer, &tmpca,
GNUTLS_X509_FMT_DER);
if (ret < 0) {