Lines Matching refs:princ
168 static void rxrpc_free_krb5_principal(struct krb5_principal *princ) in rxrpc_free_krb5_principal() argument
172 if (princ->name_parts) { in rxrpc_free_krb5_principal()
173 for (loop = princ->n_name_parts - 1; loop >= 0; loop--) in rxrpc_free_krb5_principal()
174 kfree(princ->name_parts[loop]); in rxrpc_free_krb5_principal()
175 kfree(princ->name_parts); in rxrpc_free_krb5_principal()
177 kfree(princ->realm); in rxrpc_free_krb5_principal()
215 static int rxrpc_krb5_decode_principal(struct krb5_principal *princ, in rxrpc_krb5_decode_principal() argument
234 princ->n_name_parts = n_parts; in rxrpc_krb5_decode_principal()
239 princ->name_parts = kcalloc(n_parts, sizeof(char *), GFP_KERNEL); in rxrpc_krb5_decode_principal()
240 if (!princ->name_parts) in rxrpc_krb5_decode_principal()
253 princ->name_parts[loop] = kmalloc(tmp + 1, GFP_KERNEL); in rxrpc_krb5_decode_principal()
254 if (!princ->name_parts[loop]) in rxrpc_krb5_decode_principal()
256 memcpy(princ->name_parts[loop], xdr, tmp); in rxrpc_krb5_decode_principal()
257 princ->name_parts[loop][tmp] = 0; in rxrpc_krb5_decode_principal()
271 princ->realm = kmalloc(tmp + 1, GFP_KERNEL); in rxrpc_krb5_decode_principal()
272 if (!princ->realm) in rxrpc_krb5_decode_principal()
274 memcpy(princ->realm, xdr, tmp); in rxrpc_krb5_decode_principal()
275 princ->realm[tmp] = 0; in rxrpc_krb5_decode_principal()
279 _debug("%s/...@%s", princ->name_parts[0], princ->realm); in rxrpc_krb5_decode_principal()
1047 const struct krb5_principal *princ; in rxrpc_read() local
1081 princ = &token->k5->client; in rxrpc_read()
1082 toksize += 4 + princ->n_name_parts * 4; in rxrpc_read()
1083 for (loop = 0; loop < princ->n_name_parts; loop++) in rxrpc_read()
1084 toksize += RND(strlen(princ->name_parts[loop])); in rxrpc_read()
1085 toksize += 4 + RND(strlen(princ->realm)); in rxrpc_read()
1087 princ = &token->k5->server; in rxrpc_read()
1088 toksize += 4 + princ->n_name_parts * 4; in rxrpc_read()
1089 for (loop = 0; loop < princ->n_name_parts; loop++) in rxrpc_read()
1090 toksize += RND(strlen(princ->name_parts[loop])); in rxrpc_read()
1091 toksize += 4 + RND(strlen(princ->realm)); in rxrpc_read()
1185 princ = &token->k5->client; in rxrpc_read()
1186 ENCODE(princ->n_name_parts); in rxrpc_read()
1187 for (loop = 0; loop < princ->n_name_parts; loop++) in rxrpc_read()
1188 ENCODE_STR(princ->name_parts[loop]); in rxrpc_read()
1189 ENCODE_STR(princ->realm); in rxrpc_read()
1191 princ = &token->k5->server; in rxrpc_read()
1192 ENCODE(princ->n_name_parts); in rxrpc_read()
1193 for (loop = 0; loop < princ->n_name_parts; loop++) in rxrpc_read()
1194 ENCODE_STR(princ->name_parts[loop]); in rxrpc_read()
1195 ENCODE_STR(princ->realm); in rxrpc_read()