Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
myproxy_read_pass.h
1 /*
2  * my_proxy_read_pass.h
3  *
4  * Common client side routines.
5  */
6 #ifndef _MYPROXY_READ_PASS_H
7 #define _MYPROXY_READ_PASS_H
8 
9 /* Minimum pass phrase length */
10 #define MIN_PASS_PHRASE_LEN 6
11 
12 /*
13  * myproxy_read_passphrase()
14  *
15  * Issue the specified prompt (or a standard prompt if prompt is NULL)
16  * and read the pass phrase from the tty
17  * and place it into the given buffer with length given by buffer_len.
18  * If pass phrase is greater than buffer_len bytes, it is silently
19  * truncated.
20  *
21  * Returns number of characters read, -1 on error.
22  */
23 int myproxy_read_passphrase(char *buffer,
24  int buffer_len,
25  const char *prompt);
26 
27 /*
28  * myproxy_read_passphrase_stdin()
29  *
30  * Same as myproxy_read_passphrase() except reads pass phrase from stdin.
31  */
32 int myproxy_read_passphrase_stdin(char *buffer,
33  int buffer_len,
34  const char *prompt);
35 
36 /*
37  * myproxy_read_verified_passphrase()
38  *
39  * Same as myproxy_read_passphrase except the user is prompted
40  * twice for the passphrase and both must match.
41  */
42 int myproxy_read_verified_passphrase(char *buffer,
43  int buffer_len,
44  const char *prompt);
45 
46 /*
47  * Check for good passphrases:
48  * 1. Make sure the passphrase is at least MIN_PASS_PHRASE_LEN long.
49  * 2. Optionally run an external passphrase policy program.
50  *
51  * Returns 0 if passphrase is accepted and -1 otherwise.
52  */
53 int myproxy_check_passphrase_policy(const char *passphrase,
54  const char *passphrase_policy_pgm,
55  const char *username,
56  const char *credname,
57  const char *retrievers,
58  const char *renewers,
59  const char *client_name);
60 
61 #endif /* _MYPROXY_READ_PASS_H */