Lines Matching refs:ret
105 krb5_error_code ret;
117 ret = krb5_data_alloc(rep->hash, HMAC_size(ctx));
118 if (ret) {
160 int ret;
167 ret = hx509_env_add(context->hx509ctx, &env, "principal-name",
169 if (ret)
176 ret = hx509_certs_init(context->hx509ctx, config->kx509_ca, 0,
178 if (ret) {
183 ret = hx509_query_alloc(context->hx509ctx, &q);
184 if (ret) {
192 ret = hx509_certs_find(context->hx509ctx, certs, q, &signer);
195 if (ret) {
202 ret = hx509_ca_tbs_init(context->hx509ctx, &tbs);
203 if (ret)
215 ret = der_copy_oid(&asn1_oid_id_pkcs1_rsaEncryption,
222 ret = hx509_ca_tbs_set_spki(context->hx509ctx, tbs, &spki);
224 if (ret)
232 ret = hx509_certs_init(context->hx509ctx, config->kx509_template, 0,
234 if (ret) {
239 ret = hx509_get_one_cert(context->hx509ctx, certs, &template);
241 if (ret) {
246 ret = hx509_ca_tbs_set_template(context->hx509ctx, tbs,
252 if (ret)
261 ret = hx509_ca_sign(context->hx509ctx, tbs, signer, &cert);
263 if (ret)
268 ret = hx509_cert_binary(context->hx509ctx, cert, certificate);
270 if (ret)
281 krb5_set_error_message(context, ret, "cert creation failed");
282 return ret;
295 krb5_error_code ret;
317 ret = krb5_kt_resolve(context, "HDB:", &id);
318 if (ret) {
323 ret = krb5_rd_req(context,
330 if (ret)
333 ret = krb5_ticket_get_client(context, ticket, &cprincipal);
334 if (ret)
337 ret = krb5_unparse_name(context, cprincipal, &cname);
338 if (ret)
343 ret = krb5_sname_to_principal(context, NULL, "kca_service",
345 if (ret)
351 ret = krb5_ticket_get_server(context, ticket, &principal);
352 if (ret)
355 ret = krb5_principal_compare(context, sprincipal, principal);
357 if (ret != TRUE) {
360 ret = krb5_unparse_name(context, sprincipal, &expected);
361 if (ret)
363 ret = krb5_unparse_name(context, principal, &used);
364 if (ret) {
369 ret = KRB5KDC_ERR_SERVER_NOMATCH;
370 krb5_set_error_message(context, ret,
380 ret = krb5_auth_con_getkey(context, ac, &key);
381 if (ret == 0 && key == NULL)
382 ret = KRB5KDC_ERR_NULL_KEY;
383 if (ret) {
384 krb5_set_error_message(context, ret, "Kx509 can't get session key");
388 ret = verify_req_hash(context, req, key);
389 if (ret)
397 ret = decode_RSAPublicKey(req->pk_key.data, req->pk_key.length,
399 if (ret)
403 ret = ASN1_EXTRA_DATA;
417 ret = build_certificate(context, config, &req->pk_key,
420 if (ret)
423 ret = calculate_reply_hash(context, key, &rep);
424 if (ret)
435 &size, ret);
436 if (ret) {
437 krb5_set_error_message(context, ret, "Failed to encode kx509 reply");
443 ret = krb5_data_alloc(reply, data.length + sizeof(version_2_0));
444 if (ret) {
459 if (ret)
460 krb5_warn(context, ret, "Kx509 request from %s failed", from);