1 |
|
---|
2 | KRB5_ENCRYPT(3) BSD Library Functions Manual KRB5_ENCRYPT(3)
|
---|
3 |
|
---|
4 | NNAAMMEE
|
---|
5 | kkrrbb55__ccrryyppttoo__ggeettbblloocckkssiizzee, kkrrbb55__ccrryyppttoo__ggeettccoonnffoouunnddeerrssiizzee
|
---|
6 | kkrrbb55__ccrryyppttoo__ggeetteennccttyyppee, kkrrbb55__ccrryyppttoo__ggeettppaaddssiizzee, kkrrbb55__ccrryyppttoo__oovveerrhheeaadd,
|
---|
7 | kkrrbb55__ddeeccrryypptt, kkrrbb55__ddeeccrryypptt__EEnnccrryypptteeddDDaattaa, kkrrbb55__ddeeccrryypptt__iivveecc,
|
---|
8 | kkrrbb55__ddeeccrryypptt__ttiicckkeett, kkrrbb55__eennccrryypptt, kkrrbb55__eennccrryypptt__EEnnccrryypptteeddDDaattaa,
|
---|
9 | kkrrbb55__eennccrryypptt__iivveecc, kkrrbb55__eennccttyyppee__ddiissaabbllee, kkrrbb55__eennccttyyppee__kkeeyyssiizzee,
|
---|
10 | kkrrbb55__eennccttyyppee__ttoo__ssttrriinngg, kkrrbb55__eennccttyyppee__vvaalliidd, kkrrbb55__ggeett__wwrraappppeedd__lleennggtthh,
|
---|
11 | kkrrbb55__ssttrriinngg__ttoo__eennccttyyppee -- encrypt and decrypt data, set and get encryp-
|
---|
12 | tion type parameters
|
---|
13 |
|
---|
14 | LLIIBBRRAARRYY
|
---|
15 | Kerberos 5 Library (libkrb5, -lkrb5)
|
---|
16 |
|
---|
17 | SSYYNNOOPPSSIISS
|
---|
18 | ##iinncclluuddee <<kkrrbb55..hh>>
|
---|
19 |
|
---|
20 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
21 | kkrrbb55__eennccrryypptt(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___c_r_y_p_t_o _c_r_y_p_t_o, _u_n_s_i_g_n_e_d _u_s_a_g_e,
|
---|
22 | _v_o_i_d _*_d_a_t_a, _s_i_z_e___t _l_e_n, _k_r_b_5___d_a_t_a _*_r_e_s_u_l_t);
|
---|
23 |
|
---|
24 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
25 | kkrrbb55__eennccrryypptt__EEnnccrryypptteeddDDaattaa(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___c_r_y_p_t_o _c_r_y_p_t_o,
|
---|
26 | _u_n_s_i_g_n_e_d _u_s_a_g_e, _v_o_i_d _*_d_a_t_a, _s_i_z_e___t _l_e_n, _i_n_t _k_v_n_o,
|
---|
27 | _E_n_c_r_y_p_t_e_d_D_a_t_a _*_r_e_s_u_l_t);
|
---|
28 |
|
---|
29 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
30 | kkrrbb55__eennccrryypptt__iivveecc(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___c_r_y_p_t_o _c_r_y_p_t_o,
|
---|
31 | _u_n_s_i_g_n_e_d _u_s_a_g_e, _v_o_i_d _*_d_a_t_a, _s_i_z_e___t _l_e_n, _k_r_b_5___d_a_t_a _*_r_e_s_u_l_t,
|
---|
32 | _v_o_i_d _*_i_v_e_c);
|
---|
33 |
|
---|
34 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
35 | kkrrbb55__ddeeccrryypptt(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___c_r_y_p_t_o _c_r_y_p_t_o, _u_n_s_i_g_n_e_d _u_s_a_g_e,
|
---|
36 | _v_o_i_d _*_d_a_t_a, _s_i_z_e___t _l_e_n, _k_r_b_5___d_a_t_a _*_r_e_s_u_l_t);
|
---|
37 |
|
---|
38 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
39 | kkrrbb55__ddeeccrryypptt__EEnnccrryypptteeddDDaattaa(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___c_r_y_p_t_o _c_r_y_p_t_o,
|
---|
40 | _u_n_s_i_g_n_e_d _u_s_a_g_e, _E_n_c_r_y_p_t_e_d_D_a_t_a _*_e, _k_r_b_5___d_a_t_a _*_r_e_s_u_l_t);
|
---|
41 |
|
---|
42 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
43 | kkrrbb55__ddeeccrryypptt__iivveecc(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___c_r_y_p_t_o _c_r_y_p_t_o,
|
---|
44 | _u_n_s_i_g_n_e_d _u_s_a_g_e, _v_o_i_d _*_d_a_t_a, _s_i_z_e___t _l_e_n, _k_r_b_5___d_a_t_a _*_r_e_s_u_l_t,
|
---|
45 | _v_o_i_d _*_i_v_e_c);
|
---|
46 |
|
---|
47 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
48 | kkrrbb55__ddeeccrryypptt__ttiicckkeett(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _T_i_c_k_e_t _*_t_i_c_k_e_t,
|
---|
49 | _k_r_b_5___k_e_y_b_l_o_c_k _*_k_e_y, _E_n_c_T_i_c_k_e_t_P_a_r_t _*_o_u_t, _k_r_b_5___f_l_a_g_s _f_l_a_g_s);
|
---|
50 |
|
---|
51 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
52 | kkrrbb55__ccrryyppttoo__ggeettbblloocckkssiizzee(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _s_i_z_e___t _*_b_l_o_c_k_s_i_z_e);
|
---|
53 |
|
---|
54 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
55 | kkrrbb55__ccrryyppttoo__ggeetteennccttyyppee(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___c_r_y_p_t_o _c_r_y_p_t_o,
|
---|
56 | _k_r_b_5___e_n_c_t_y_p_e _*_e_n_c_t_y_p_e);
|
---|
57 |
|
---|
58 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
59 | kkrrbb55__ccrryyppttoo__ggeettppaaddssiizzee(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _s_i_z_e___t, _*_p_a_d_s_i_z_e_");
|
---|
60 |
|
---|
61 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
62 | kkrrbb55__ccrryyppttoo__ggeettccoonnffoouunnddeerrssiizzee(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___c_r_y_p_t_o _c_r_y_p_t_o,
|
---|
63 | _s_i_z_e___t, _*_c_o_n_f_o_u_n_d_e_r_s_i_z_e_");
|
---|
64 |
|
---|
65 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
66 | kkrrbb55__eennccttyyppee__kkeeyyssiizzee(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___e_n_c_t_y_p_e _t_y_p_e,
|
---|
67 | _s_i_z_e___t _*_k_e_y_s_i_z_e);
|
---|
68 |
|
---|
69 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
70 | kkrrbb55__ccrryyppttoo__oovveerrhheeaadd(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _s_i_z_e___t, _*_p_a_d_s_i_z_e_");
|
---|
71 |
|
---|
72 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
73 | kkrrbb55__ssttrriinngg__ttoo__eennccttyyppee(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g,
|
---|
74 | _k_r_b_5___e_n_c_t_y_p_e _*_e_t_y_p_e);
|
---|
75 |
|
---|
76 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
77 | kkrrbb55__eennccttyyppee__ttoo__ssttrriinngg(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___e_n_c_t_y_p_e _e_t_y_p_e,
|
---|
78 | _c_h_a_r _*_*_s_t_r_i_n_g);
|
---|
79 |
|
---|
80 | _k_r_b_5___e_r_r_o_r___c_o_d_e
|
---|
81 | kkrrbb55__eennccttyyppee__vvaalliidd(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___e_n_c_t_y_p_e _e_t_y_p_e);
|
---|
82 |
|
---|
83 | _v_o_i_d
|
---|
84 | kkrrbb55__eennccttyyppee__ddiissaabbllee(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___e_n_c_t_y_p_e _e_t_y_p_e);
|
---|
85 |
|
---|
86 | _s_i_z_e___t
|
---|
87 | kkrrbb55__ggeett__wwrraappppeedd__lleennggtthh(_k_r_b_5___c_o_n_t_e_x_t _c_o_n_t_e_x_t, _k_r_b_5___c_r_y_p_t_o _c_r_y_p_t_o,
|
---|
88 | _s_i_z_e___t _d_a_t_a___l_e_n);
|
---|
89 |
|
---|
90 | DDEESSCCRRIIPPTTIIOONN
|
---|
91 | These functions are used to encrypt and decrypt data.
|
---|
92 |
|
---|
93 | kkrrbb55__eennccrryypptt__iivveecc() puts the encrypted version of _d_a_t_a (of size _l_e_n) in
|
---|
94 | _r_e_s_u_l_t. If the encryption type supports using derived keys, _u_s_a_g_e should
|
---|
95 | be the appropriate key-usage. _i_v_e_c is a pointer to a initial IV, it is
|
---|
96 | modified to the end IV at the end of the round. Ivec should be the size
|
---|
97 | of If NULL is passed in, the default IV is used. kkrrbb55__eennccrryypptt() does the
|
---|
98 | same as kkrrbb55__eennccrryypptt__iivveecc() but with _i_v_e_c being NULL.
|
---|
99 | kkrrbb55__eennccrryypptt__EEnnccrryypptteeddDDaattaa() does the same as kkrrbb55__eennccrryypptt(), but it puts
|
---|
100 | the encrypted data in a _E_n_c_r_y_p_t_e_d_D_a_t_a structure instead. If _k_v_n_o is not
|
---|
101 | zero, it will be put in the (optional) _k_v_n_o field in the _E_n_c_r_y_p_t_e_d_D_a_t_a.
|
---|
102 |
|
---|
103 | kkrrbb55__ddeeccrryypptt__iivveecc(), kkrrbb55__ddeeccrryypptt(), and kkrrbb55__ddeeccrryypptt__EEnnccrryypptteeddDDaattaa()
|
---|
104 | works similarly.
|
---|
105 |
|
---|
106 | kkrrbb55__ddeeccrryypptt__ttiicckkeett() decrypts the encrypted part of _t_i_c_k_e_t with _k_e_y.
|
---|
107 | kkrrbb55__ddeeccrryypptt__ttiicckkeett() also verifies the timestamp in the ticket, invalid
|
---|
108 | flag and if the KDC haven't verified the transited path, the transit
|
---|
109 | path.
|
---|
110 |
|
---|
111 | kkrrbb55__eennccttyyppee__kkeeyyssiizzee(), kkrrbb55__ccrryyppttoo__ggeettccoonnffoouunnddeerrssiizzee(),
|
---|
112 | kkrrbb55__ccrryyppttoo__ggeettbblloocckkssiizzee(), kkrrbb55__ccrryyppttoo__ggeetteennccttyyppee(),
|
---|
113 | kkrrbb55__ccrryyppttoo__ggeettppaaddssiizzee(), kkrrbb55__ccrryyppttoo__oovveerrhheeaadd() all returns various
|
---|
114 | (sometimes) useful information from a crypto context.
|
---|
115 | kkrrbb55__ccrryyppttoo__oovveerrhheeaadd() is the combination of krb5_crypto_getconfounder-
|
---|
116 | size, krb5_crypto_getblocksize and krb5_crypto_getpadsize and return the
|
---|
117 | maximum overhead size.
|
---|
118 |
|
---|
119 | kkrrbb55__eennccttyyppee__ttoo__ssttrriinngg() converts a encryption type number to a string
|
---|
120 | that can be printable and stored. The strings returned should be freed
|
---|
121 | with free(3).
|
---|
122 |
|
---|
123 | kkrrbb55__ssttrriinngg__ttoo__eennccttyyppee() converts a encryption type strings to a encryp-
|
---|
124 | tion type number that can use used for other Kerberos crypto functions.
|
---|
125 |
|
---|
126 | kkrrbb55__eennccttyyppee__vvaalliidd() returns 0 if the encrypt is supported and not dis-
|
---|
127 | abled, otherwise and error code is returned.
|
---|
128 |
|
---|
129 | kkrrbb55__eennccttyyppee__ddiissaabbllee() (globally, for all contextes) disables the
|
---|
130 | _e_n_c_t_y_p_e.
|
---|
131 |
|
---|
132 | kkrrbb55__ggeett__wwrraappppeedd__lleennggtthh() returns the size of an encrypted packet by
|
---|
133 | _c_r_y_p_t_o of length _d_a_t_a___l_e_n.
|
---|
134 |
|
---|
135 | SSEEEE AALLSSOO
|
---|
136 | krb5_create_checksum(3), krb5_crypto_init(3)
|
---|
137 |
|
---|
138 | HEIMDAL March 20, 2004 HEIMDAL
|
---|