OpenVPN 3 Core Library
Loading...
Searching...
No Matches
getpw.hpp
Go to the documentation of this file.
1
// OpenVPN -- An application to securely tunnel IP networks
2
// over a single port, with support for SSL/TLS-based
3
// session authentication and key exchange,
4
// packet encryption, packet authentication, and
5
// packet compression.
6
//
7
// Copyright (C) 2012- OpenVPN Inc.
8
//
9
// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10
//
11
12
#ifndef OPENVPN_COMMON_GETPW_H
13
#define OPENVPN_COMMON_GETPW_H
14
15
#include <
openvpn/common/platform.hpp
>
16
17
#if !defined(OPENVPN_PLATFORM_WIN)
18
#include <pwd.h>
19
#include <unistd.h>
20
#else
21
#include <
openvpn/win/console.hpp
>
22
#endif
23
24
#include <string>
25
26
#include <
openvpn/common/exception.hpp
>
27
28
namespace
openvpn
{
29
inline
std::string
get_password
(
const
char
*prompt)
30
{
31
#if !defined(OPENVPN_PLATFORM_WIN)
32
char
*
ret
= getpass(prompt);
33
return
ret
;
34
#else
35
Win::Console::Input
i{
true
};
36
return
i.
get_password
(prompt);
37
#endif
38
}
39
}
// namespace openvpn
40
41
#endif
openvpn::Win::Console::Input
Definition
console.hpp:24
openvpn::Win::Console::Input::get_password
std::string get_password(const std::string &prompt)
Definition
console.hpp:76
console.hpp
exception.hpp
openvpn
Support deferred server-side state creation when client connects.
Definition
ovpncli.cpp:95
openvpn::get_password
std::string get_password(const char *prompt)
Definition
getpw.hpp:29
platform.hpp
ret
std::string ret
Definition
test_capture.cpp:267
openvpn
common
getpw.hpp
Generated by
1.9.8