return i ?: ret;
}
-static int request_passphrase(struct openconnect_info *vpninfo,
- char **response, const char *fmt, ...)
-{
- struct oc_auth_form f;
- struct oc_form_opt o;
- char buf[1024];
- va_list args;
- int ret;
-
- if (!vpninfo->process_auth_form)
- return -EINVAL;
-
- buf[1023] = 0;
- memset(&f, 0, sizeof(f));
- va_start(args, fmt);
- vsnprintf(buf, 1023, fmt, args);
- va_end(args);
-
- f.auth_id = (char *)"ssl_certificate";
- f.opts = &o;
-
- o.next = NULL;
- o.type = OC_FORM_OPT_PASSWORD;
- o.name = (char *)"passphrase";
- o.label = buf;
- o.value = NULL;
-
- ret = vpninfo->process_auth_form(vpninfo, &f);
- if (!ret) {
- *response = o.value;
- return 0;
- }
-
- return -EIO;
-}
-
static int check_certificate_expiry(struct openconnect_info *vpninfo, gnutls_x509_crt_t cert)
{
const char *reason = NULL;
/* ssl.c */
int connect_https_socket(struct openconnect_info *vpninfo);
-
-/* ${SSL_LIBRARY}.c */
+int request_passphrase(struct openconnect_info *vpninfo,
+ char **response, const char *fmt, ...);
int __attribute__ ((format (printf, 2, 3)))
openconnect_SSL_printf(struct openconnect_info *vpninfo, const char *fmt, ...);
+
+/* ${SSL_LIBRARY}.c */
int openconnect_SSL_gets(struct openconnect_info *vpninfo, char *buf, size_t len);
int openconnect_SSL_write(struct openconnect_info *vpninfo, char *buf, size_t len);
int openconnect_SSL_read(struct openconnect_info *vpninfo, char *buf, size_t len);
}
+int request_passphrase(struct openconnect_info *vpninfo,
+ char **response, const char *fmt, ...)
+{
+ struct oc_auth_form f;
+ struct oc_form_opt o;
+ char buf[1024];
+ va_list args;
+ int ret;
+
+ if (!vpninfo->process_auth_form)
+ return -EINVAL;
+
+ buf[1023] = 0;
+ memset(&f, 0, sizeof(f));
+ va_start(args, fmt);
+ vsnprintf(buf, 1023, fmt, args);
+ va_end(args);
+
+ f.auth_id = (char *)"ssl_certificate";
+ f.opts = &o;
+
+ o.next = NULL;
+ o.type = OC_FORM_OPT_PASSWORD;
+ o.name = (char *)"passphrase";
+ o.label = buf;
+ o.value = NULL;
+
+ ret = vpninfo->process_auth_form(vpninfo, &f);
+ if (!ret) {
+ *response = o.value;
+ return 0;
+ }
+
+ return -EIO;
+}
+
#if defined(__sun__) || defined(__NetBSD__) || defined(__DragonFly__)
int openconnect_passphrase_from_fsid(struct openconnect_info *vpninfo)
{