diff options
Diffstat (limited to 'src/lib/gssapi')
-rw-r--r-- | src/lib/gssapi/generic/disp_major_status.c | 66 | ||||
-rw-r--r-- | src/lib/gssapi/krb5/acquire_cred.c | 5 | ||||
-rw-r--r-- | src/lib/gssapi/mechglue/g_dsp_status.c | 93 | ||||
-rw-r--r-- | src/lib/gssapi/spnego/spnego_mech.c | 15 |
4 files changed, 90 insertions, 89 deletions
diff --git a/src/lib/gssapi/generic/disp_major_status.c b/src/lib/gssapi/generic/disp_major_status.c index 5098e3abd4..e4ff722c9c 100644 --- a/src/lib/gssapi/generic/disp_major_status.c +++ b/src/lib/gssapi/generic/disp_major_status.c @@ -34,18 +34,18 @@ #define GSS_ERROR_STR(value, array, select, min, max, num) \ (((select(value) < (min)) || (select(value) > (max))) ? NULL : \ - (array)[num(value)]) + _((array)[num(value)])) /**/ static const char * const calling_error_string[] = { NULL, - "A required input parameter could not be read", - "A required input parameter could not be written", - "A parameter was malformed", + N_("A required input parameter could not be read"), + N_("A required input parameter could not be written"), + N_("A parameter was malformed"), }; -static const char * const calling_error = "calling error"; +static const char * const calling_error = N_("calling error"); #define GSS_CALLING_ERROR_STR(x) \ GSS_ERROR_STR((x), calling_error_string, GSS_CALLING_ERROR, \ @@ -56,25 +56,25 @@ static const char * const calling_error = "calling error"; static const char * const routine_error_string[] = { NULL, - "An unsupported mechanism was requested", - "An invalid name was supplied", - "A supplied name was of an unsupported type", - "Incorrect channel bindings were supplied", - "An invalid status code was supplied", - "A token had an invalid signature", - "No credentials were supplied", - "No context has been established", - "A token was invalid", - "A credential was invalid", - "The referenced credentials have expired", - "The context has expired", - "Miscellaneous failure", - "The quality-of-protection requested could not be provided", - "The operation is forbidden by the local security policy", - "The operation or option is not available", + N_("An unsupported mechanism was requested"), + N_("An invalid name was supplied"), + N_("A supplied name was of an unsupported type"), + N_("Incorrect channel bindings were supplied"), + N_("An invalid status code was supplied"), + N_("A token had an invalid signature"), + N_("No credentials were supplied"), + N_("No context has been established"), + N_("A token was invalid"), + N_("A credential was invalid"), + N_("The referenced credentials have expired"), + N_("The context has expired"), + N_("Miscellaneous failure"), + N_("The quality-of-protection requested could not be provided"), + N_("The operation is forbidden by the local security policy"), + N_("The operation or option is not available"), }; -static const char * const routine_error = "routine error"; +static const char * const routine_error = N_("routine error"); #define GSS_ROUTINE_ERROR_STR(x) \ GSS_ERROR_STR((x), routine_error_string, GSS_ROUTINE_ERROR, \ @@ -86,13 +86,13 @@ static const char * const routine_error = "routine error"; /* this becomes overly gross after about 4 strings */ static const char * const sinfo_string[] = { - "The routine must be called again to complete its function", - "The token was a duplicate of an earlier token", - "The token's validity period has expired", - "A later token has already been processed", + N_("The routine must be called again to complete its function"), + N_("The token was a duplicate of an earlier token"), + N_("The token's validity period has expired"), + N_("A later token has already been processed"), }; -static const char * const sinfo_code = "supplementary info code"; +static const char * const sinfo_code = N_("supplementary info code"); #define LSBGET(x) ((((x)^((x)-1))+1)>>1) #define LSBMASK(n) ((1<<(n))^((1<<(n))-1)) @@ -103,8 +103,8 @@ static const char * const sinfo_code = "supplementary info code"; /**/ -static const char * const no_error = "No error"; -static const char * const unknown_error = "Unknown %s (field = %d)"; +static const char * const no_error = N_("No error"); +static const char * const unknown_error = N_("Unknown %s (field = %d)"); /**/ @@ -116,7 +116,7 @@ display_unknown(kind, value, buffer) { char *str; - if (asprintf(&str, unknown_error, kind, value) < 0) + if (asprintf(&str, _(unknown_error), kind, value) < 0) return(0); buffer->length = strlen(str); @@ -140,7 +140,7 @@ static OM_uint32 display_calling(minor_status, code, status_string) return(GSS_S_FAILURE); } } else { - if (! display_unknown(calling_error, GSS_CALLING_ERROR_FIELD(code), + if (! display_unknown(_(calling_error), GSS_CALLING_ERROR_FIELD(code), status_string)) { *minor_status = ENOMEM; return(GSS_S_FAILURE); @@ -165,7 +165,7 @@ static OM_uint32 display_routine(minor_status, code, status_string) return(GSS_S_FAILURE); } } else { - if (! display_unknown(routine_error, GSS_ROUTINE_ERROR_FIELD(code), + if (! display_unknown(_(routine_error), GSS_ROUTINE_ERROR_FIELD(code), status_string)) { *minor_status = ENOMEM; return(GSS_S_FAILURE); @@ -190,7 +190,7 @@ static OM_uint32 display_bit(minor_status, code, status_string) return(GSS_S_FAILURE); } } else { - if (! display_unknown(sinfo_code, 1<<code, status_string)) { + if (! display_unknown(_(sinfo_code), 1<<code, status_string)) { *minor_status = ENOMEM; return(GSS_S_FAILURE); } diff --git a/src/lib/gssapi/krb5/acquire_cred.c b/src/lib/gssapi/krb5/acquire_cred.c index 664f07bf6f..ca5438bc13 100644 --- a/src/lib/gssapi/krb5/acquire_cred.c +++ b/src/lib/gssapi/krb5/acquire_cred.c @@ -169,8 +169,9 @@ check_keytab(krb5_context context, krb5_keytab kt, krb5_gss_name_t name) if (code == KRB5_KT_END) { code = KRB5_KT_NOTFOUND; if (krb5_unparse_name(context, accprinc, &princname) == 0) { - krb5_set_error_message(context, code, "No key table entry " - "found matching %s", princname); + krb5_set_error_message(context, code, + _("No key table entry found matching %s"), + princname); free(princname); } } diff --git a/src/lib/gssapi/mechglue/g_dsp_status.c b/src/lib/gssapi/mechglue/g_dsp_status.c index 4357266090..13f104bea8 100644 --- a/src/lib/gssapi/mechglue/g_dsp_status.c +++ b/src/lib/gssapi/mechglue/g_dsp_status.c @@ -158,25 +158,25 @@ gss_buffer_t outStr; /* take care of the success value first */ if (status == GSS_S_COMPLETE) - errStr = "The routine completed successfully"; + errStr = _("The routine completed successfully"); else if (*msgCtxt == 0 && (oneVal = GSS_CALLING_ERROR(status))) { switch (oneVal) { case GSS_S_CALL_INACCESSIBLE_READ: - errStr = "A required input parameter" - " could not be read"; + errStr = _("A required input parameter could not be " + "read"); break; case GSS_S_CALL_INACCESSIBLE_WRITE: - errStr = "A required output parameter" - " could not be written"; + errStr = _("A required output parameter could not be " + "written"); break; case GSS_S_CALL_BAD_STRUCTURE: - errStr = "A parameter was malformed"; + errStr = _("A parameter was malformed"); break; default: - errStr = "An invalid status code was supplied"; + errStr = _("An invalid status code was supplied"); break; } @@ -192,89 +192,86 @@ gss_buffer_t outStr; (oneVal = GSS_ROUTINE_ERROR(status))) { switch (oneVal) { case GSS_S_BAD_MECH: - errStr = "An unsupported mechanism" - " was requested"; + errStr = _("An unsupported mechanism was requested"); break; case GSS_S_BAD_NAME: - errStr = "An invalid name was supplied"; + errStr = _("An invalid name was supplied"); break; case GSS_S_BAD_NAMETYPE: - errStr = "A supplied name was of an" - " unsupported type"; + errStr = _("A supplied name was of an unsupported " + "type"); break; case GSS_S_BAD_BINDINGS: - errStr = "Incorrect channel bindings" - " were supplied"; + errStr = _("Incorrect channel bindings were supplied"); break; case GSS_S_BAD_SIG: /* same as GSS_S_BAD_MIC: */ - errStr = "A token had an invalid Message" - " Integrity Check (MIC)"; + errStr = _("A token had an invalid Message Integrity " + "Check (MIC)"); break; case GSS_S_NO_CRED: - errStr = "No credentials were supplied, or the" - " credentials were unavailable or" - " inaccessible"; + errStr = _("No credentials were supplied, or the " + "credentials were unavailable or " + "inaccessible"); break; case GSS_S_NO_CONTEXT: - errStr = "No context has been established"; + errStr = _("No context has been established"); break; case GSS_S_DEFECTIVE_TOKEN: - errStr = "Invalid token was supplied"; + errStr = _("Invalid token was supplied"); break; case GSS_S_DEFECTIVE_CREDENTIAL: - errStr = "Invalid credential was supplied"; + errStr = _("Invalid credential was supplied"); break; case GSS_S_CREDENTIALS_EXPIRED: - errStr = "The referenced credential has" - " expired"; + errStr = _("The referenced credential has expired"); break; case GSS_S_CONTEXT_EXPIRED: - errStr = "The referenced context has expired"; + errStr = _("The referenced context has expired"); break; case GSS_S_FAILURE: - errStr = "Unspecified GSS failure. Minor code" - " may provide more information"; + errStr = _("Unspecified GSS failure. Minor code " + "may provide more information"); break; case GSS_S_BAD_QOP: - errStr = "The quality-of-protection (QOP) " - "requested could not be provided"; + errStr = _("The quality-of-protection (QOP) " + "requested could not be provided"); break; case GSS_S_UNAUTHORIZED: - errStr = "The operation is forbidden by local" - " security policy"; + errStr = _("The operation is forbidden by local " + " security policy"); break; case GSS_S_UNAVAILABLE: - errStr = "The operation or option is not" - " available or unsupported"; + errStr = _("The operation or option is not " + "available or unsupported"); break; case GSS_S_DUPLICATE_ELEMENT: - errStr = "The requested credential element" - " already exists"; + errStr = _("The requested credential element " + "already exists"); break; case GSS_S_NAME_NOT_MN: - errStr = "The provided name was not mechanism" - " specific (MN)"; + errStr = _("The provided name was not mechanism " + "specific (MN)"); break; case GSS_S_BAD_STATUS: default: - errStr = "An invalid status code was supplied"; + errStr = _("An invalid status code was supplied"); } /* we must determine if the caller should call us again */ @@ -311,32 +308,30 @@ gss_buffer_t outStr; switch (currErr) { case GSS_S_CONTINUE_NEEDED: - errStr = "The routine must be called again to" - " complete its function"; + errStr = _("The routine must be called again to " + "complete its function"); break; case GSS_S_DUPLICATE_TOKEN: - errStr = "The token was a duplicate of an" - " earlier token"; + errStr = _("The token was a duplicate of an earlier " + "token"); break; case GSS_S_OLD_TOKEN: - errStr = "The token's validity period" - " has expired"; + errStr = _("The token's validity period has expired"); break; case GSS_S_UNSEQ_TOKEN: - errStr = "A later token has already been" - " processed"; + errStr = _("A later token has already been processed"); break; case GSS_S_GAP_TOKEN: - errStr = "An expected per-message token was" - " not received"; + errStr = _("An expected per-message token was not " + "received"); break; default: - errStr = "An invalid status code was supplied"; + errStr = _("An invalid status code was supplied"); } /* diff --git a/src/lib/gssapi/spnego/spnego_mech.c b/src/lib/gssapi/spnego/spnego_mech.c index 3467ee0d79..3beb93ec40 100644 --- a/src/lib/gssapi/spnego/spnego_mech.c +++ b/src/lib/gssapi/spnego/spnego_mech.c @@ -1792,23 +1792,28 @@ spnego_gss_display_status( switch (status_value) { case ERR_SPNEGO_NO_MECHS_AVAILABLE: /* CSTYLED */ - *status_string = make_err_msg("SPNEGO cannot find mechanisms to negotiate"); + *status_string = make_err_msg(_("SPNEGO cannot find " + "mechanisms to negotiate")); break; case ERR_SPNEGO_NO_CREDS_ACQUIRED: /* CSTYLED */ - *status_string = make_err_msg("SPNEGO failed to acquire creds"); + *status_string = make_err_msg(_("SPNEGO failed to acquire " + "creds")); break; case ERR_SPNEGO_NO_MECH_FROM_ACCEPTOR: /* CSTYLED */ - *status_string = make_err_msg("SPNEGO acceptor did not select a mechanism"); + *status_string = make_err_msg(_("SPNEGO acceptor did not " + "select a mechanism")); break; case ERR_SPNEGO_NEGOTIATION_FAILED: /* CSTYLED */ - *status_string = make_err_msg("SPNEGO failed to negotiate a mechanism"); + *status_string = make_err_msg(_("SPNEGO failed to negotiate a " + "mechanism")); break; case ERR_SPNEGO_NO_TOKEN_FROM_ACCEPTOR: /* CSTYLED */ - *status_string = make_err_msg("SPNEGO acceptor did not return a valid token"); + *status_string = make_err_msg(_("SPNEGO acceptor did not " + "return a valid token")); break; default: status_string->length = 0; |