-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;
-}
-