+1998-05-18 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * inq_cred.c (krb5_gss_inquire_cred):
+ * inq_context.c (krb5_gss_inquire_context):
+ * import_name.c (krb5_gss_import_name):
+ * export_name.c (krb5_gss_export_name):
+ * disp_name.c (krb5_gss_display_name):
+ * context_time.c (krb5_gss_context_time):
+ * acquire_cred.c (krb5_gss_acquire_cred): Clean up -Wall flames.
+
+ * indicate_mechs.c (krb5_gss_indicate_mechs): Return a dynamic OID
+ set.
+
Fri Feb 27 18:41:08 1998 Theodore Y. Ts'o <tytso@mit.edu>
* export_name.c (krb5_gss_export_name): Fix bug in
/* open the default keytab */
- if (code = krb5_kt_default(context, &kt)) {
+ if ((code = krb5_kt_default(context, &kt))) {
*minor_status = code;
return(GSS_S_CRED_UNAVAIL);
}
requested, use the default sn2princ output */
if (desired_name == (gss_name_t) NULL) {
- if (code = krb5_sname_to_principal(context, NULL, NULL, KRB5_NT_SRV_HST,
- &princ)) {
+ if ((code = krb5_sname_to_principal(context, NULL, NULL, KRB5_NT_SRV_HST,
+ &princ))) {
(void) krb5_kt_close(context, kt);
*minor_status = code;
return(GSS_S_FAILURE);
princ = (krb5_principal) desired_name;
}
- if (code = krb5_kt_get_entry(context, kt, princ, 0, 0, &entry)) {
+ if ((code = krb5_kt_get_entry(context, kt, princ, 0, 0, &entry))) {
(void) krb5_kt_close(context, kt);
if (code == KRB5_KT_NOTFOUND)
*minor_status = KG_KEYTAB_NOMATCH;
/* open the default credential cache */
- if (code = krb5_cc_default(context, &ccache)) {
+ if ((code = krb5_cc_default(context, &ccache))) {
*minor_status = code;
return(GSS_S_CRED_UNAVAIL);
}
/* turn off OPENCLOSE mode while extensive frobbing is going on */
flags = 0; /* turns off OPENCLOSE mode */
- if (code = krb5_cc_set_flags(context, ccache, flags)) {
+ if ((code = krb5_cc_set_flags(context, ccache, flags))) {
*minor_status = code;
return(GSS_S_CRED_UNAVAIL);
}
/* get out the principal name and see if it matches */
- if (code = krb5_cc_get_principal(context, ccache, &princ)) {
+ if ((code = krb5_cc_get_principal(context, ccache, &princ))) {
(void)krb5_cc_close(context, ccache);
*minor_status = code;
return(GSS_S_FAILURE);
/* iterate over the ccache, find the tgt */
- if (code = krb5_cc_start_seq_get(context, ccache, &cur)) {
+ if ((code = krb5_cc_start_seq_get(context, ccache, &cur))) {
(void)krb5_cc_close(context, ccache);
*minor_status = code;
return(GSS_S_FAILURE);
return(GSS_S_FAILURE);
} else {
/* this means that we found an endtime to use. */
- if (code = krb5_cc_end_seq_get(context, ccache, &cur)) {
+ if ((code = krb5_cc_end_seq_get(context, ccache, &cur))) {
(void)krb5_cc_close(context, ccache);
*minor_status = code;
return(GSS_S_FAILURE);
}
flags = KRB5_TC_OPENCLOSE; /* turns on OPENCLOSE mode */
- if (code = krb5_cc_set_flags(context, ccache, flags)) {
+ if ((code = krb5_cc_set_flags(context, ccache, flags))) {
(void)krb5_cc_close(context, ccache);
*minor_status = code;
return(GSS_S_FAILURE);
/* if the princ wasn't filled in already, fill it in now */
if (!cred->princ)
- if (code = krb5_copy_principal(context, (krb5_principal) desired_name,
- &(cred->princ))) {
+ if ((code = krb5_copy_principal(context, (krb5_principal) desired_name,
+ &(cred->princ)))) {
if (cred->ccache)
(void)krb5_cc_close(context, cred->ccache);
if (cred->keytab)
} else {
krb5_timestamp now;
- if (code = krb5_timeofday(context, &now)) {
+ if ((code = krb5_timeofday(context, &now))) {
if (cred->ccache)
(void)krb5_cc_close(context, cred->ccache);
if (cred->keytab)
return(GSS_S_NO_CONTEXT);
}
- if (code = krb5_timeofday(context, &now)) {
+ if ((code = krb5_timeofday(context, &now))) {
*minor_status = code;
return(GSS_S_FAILURE);
}
return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
}
- if (code = krb5_unparse_name(context, (krb5_principal) input_name, &str)) {
+ if ((code = krb5_unparse_name(context,
+ (krb5_principal) input_name, &str))) {
*minor_status = code;
return(GSS_S_FAILURE);
}
return(GSS_S_CALL_BAD_STRUCTURE|GSS_S_BAD_NAME);
}
- if (code = krb5_unparse_name(context, (krb5_principal) input_name,
- &str)) {
+ if ((code = krb5_unparse_name(context, (krb5_principal) input_name,
+ &str))) {
*minor_status = code;
return(GSS_S_FAILURE);
}
tmp[input_name_buffer->length] = 0;
service = tmp;
- if (host = strchr(tmp, '@')) {
+ if ((host = strchr(tmp, '@'))) {
*host = '\0';
host++;
}
gss_OID_set *mech_set;
{
*minor_status = 0;
- *mech_set = (gss_OID_set) gss_mech_set_krb5;
+
+ if (! g_copy_OID_set(gss_mech_set_krb5, mech_set)) {
+ *mech_set = GSS_C_NO_OID_SET;
+ *minor_status = ENOMEM;
+ return(GSS_S_FAILURE);
+ }
+
return(GSS_S_COMPLETE);
}
init = NULL;
accept = NULL;
- if (code = krb5_timeofday(context, &now)) {
+ if ((code = krb5_timeofday(context, &now))) {
*minor_status = code;
return(GSS_S_FAILURE);
}
lifetime = 0;
if (initiator_name) {
- if (code = krb5_copy_principal(context,
- ctx->initiate?ctx->here:ctx->there,
- &init)) {
+ if ((code = krb5_copy_principal(context,
+ ctx->initiate?ctx->here:ctx->there,
+ &init))) {
*minor_status = code;
return(GSS_S_FAILURE);
}
}
if (acceptor_name) {
- if (code = krb5_copy_principal(context,
- ctx->initiate?ctx->there:ctx->here,
- &accept)) {
+ if ((code = krb5_copy_principal(context,
+ ctx->initiate?ctx->there:ctx->here,
+ &accept))) {
if (init) krb5_free_principal(context, init);
*minor_status = code;
return(GSS_S_FAILURE);
cred = (krb5_gss_cred_id_t) cred_handle;
- if (code = krb5_timeofday(context, &now)) {
+ if ((code = krb5_timeofday(context, &now))) {
*minor_status = code;
return(GSS_S_FAILURE);
}
lifetime = GSS_C_INDEFINITE;
if (name) {
- if (code = krb5_copy_principal(context, cred->princ, &ret_name)) {
+ if ((code = krb5_copy_principal(context, cred->princ, &ret_name))) {
*minor_status = code;
return(GSS_S_FAILURE);
}
return(ENOMEM);
}
- if (code = kg_make_confounder(enc_ed, plain)) {
+ if ((code = kg_make_confounder(enc_ed, plain))) {
xfree(plain);
xfree(md5cksum.contents);
xfree(t);
}
if (encrypt) {
- if (code = kg_encrypt(context, enc_ed, NULL, (krb5_pointer) plain,
- (krb5_pointer) (ptr+cksum_size+14), tmsglen)) {
+ if ((code = kg_encrypt(context, enc_ed, NULL, (krb5_pointer) plain,
+ (krb5_pointer) (ptr+cksum_size+14),
+ tmsglen))) {
if (plain)
xfree(plain);
xfree(md5cksum.contents);
xfree(cksum.contents);
#else
- if (code = kg_encrypt(context, seq_ed,
- (g_OID_equal(oid, gss_mech_krb5_old) ?
- seq_ed->key->contents : NULL),
- md5cksum.contents, md5cksum.contents, 16)) {
+ if ((code = kg_encrypt(context, seq_ed,
+ (g_OID_equal(oid, gss_mech_krb5_old) ?
+ seq_ed->key->contents : NULL),
+ md5cksum.contents, md5cksum.contents, 16))) {
xfree(md5cksum.contents);
xfree(t);
return code;
/* create the seq_num */
- if (code = kg_make_seq_num(context, seq_ed, direction?0:0xff, *seqnum,
- ptr+14, ptr+6)) {
+ if ((code = kg_make_seq_num(context, seq_ed, direction?0:0xff, *seqnum,
+ ptr+14, ptr+6))) {
xfree(t);
return(code);
}