File: krb5_rd_req.rst.txt

package info (click to toggle)
krb5 1.18.3-6%2Bdeb11u5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 52,500 kB
  • sloc: ansic: 302,656; exp: 13,173; cpp: 9,693; python: 9,298; javascript: 9,118; makefile: 7,158; sh: 6,305; perl: 1,926; asm: 1,460; yacc: 1,005; awk: 396; csh: 147; xml: 135; lisp: 104; sed: 41
file content (105 lines) | stat: -rw-r--r-- 2,984 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
krb5_rd_req -  Parse and decrypt a KRB_AP_REQ message. 
=======================================================

..

.. c:function:: krb5_error_code krb5_rd_req(krb5_context context, krb5_auth_context * auth_context, const krb5_data * inbuf, krb5_const_principal server, krb5_keytab keytab, krb5_flags * ap_req_options, krb5_ticket ** ticket)

..


:param:

	          **[in]** **context** - Library context

	          **[inout]** **auth_context** - Pre-existing or newly created auth context

	          **[in]** **inbuf** - AP-REQ message to be parsed

	          **[in]** **server** - Matching principal for server, or NULL to allow any principal in keytab

	          **[in]** **keytab** - Key table, or NULL to use the default

	          **[out]** **ap_req_options** - If non-null, the AP-REQ flags on output

	          **[out]** **ticket** - If non-null, ticket from the AP-REQ message


..


:retval:
         -   0   Success; otherwise - Kerberos error codes


..







This function parses, decrypts and verifies a AP-REQ message from *inbuf* and stores the authenticator in *auth_context* .



If a keyblock was specified in *auth_context* using :c:func:`krb5_auth_con_setuseruserkey()` , that key is used to decrypt the ticket in AP-REQ message and *keytab* is ignored. In this case, *server* should be specified as a complete principal name to allow for proper transited-path checking and replay cache selection.



Otherwise, the decryption key is obtained from *keytab* , or from the default keytab if it is NULL. In this case, *server* may be a complete principal name, a matching principal (see :c:func:`krb5_sname_match()` ), or NULL to match any principal name. The keys tried against the encrypted part of the ticket are determined as follows:



 
 
	 - If *server* is a complete principal name, then its entry in *keytab* is tried.
 
 
	 - Otherwise, if *keytab* is iterable, then all entries in *keytab* which match *server* are tried.
 
 
	 - Otherwise, the server principal in the ticket must match *server* , and its entry in *keytab* is tried.
 
 



The client specified in the decrypted authenticator must match the client specified in the decrypted ticket.



If the *remote_addr* field of *auth_context* is set, the request must come from that address.



If a replay cache handle is provided in the *auth_context* , the authenticator and ticket are verified against it. If no conflict is found, the new authenticator is then stored in the replay cache of *auth_context* .



Various other checks are performed on the decoded data, including cross-realm policy, clockskew, and ticket validation times.



On success the authenticator, subkey, and remote sequence number of the request are stored in *auth_context* . If the :data:`AP_OPTS_MUTUAL_REQUIRED` bit is set, the local sequence number is XORed with the remote sequence number in the request.



Use :c:func:`krb5_free_ticket()` to free *ticket* when it is no longer needed.










..