krb5_ap_rep *
KRB5_AP__REP2krb5_ap_rep(val, error)
-const register struct type_KRB5_AP__REP *val;
+register const struct type_KRB5_AP__REP *val;
register int *error;
{
register krb5_ap_rep *retval;
krb5_ap_req *
KRB5_AP__REQ2krb5_ap_req(val, error)
-const register struct type_KRB5_AP__REQ *val;
+register const struct type_KRB5_AP__REQ *val;
register int *error;
{
register krb5_ap_req *retval;
krb5_ap_rep_enc_part *
KRB5_EncAPRepPart2krb5_ap_rep_enc_part(val, error)
-const register struct type_KRB5_EncAPRepPart *val;
+register const struct type_KRB5_EncAPRepPart *val;
register int *error;
{
register krb5_ap_rep_enc_part *retval;
krb5_authenticator *
KRB5_Authenticator2krb5_authenticator(val, error)
-const register struct type_KRB5_Authenticator *val;
+register const struct type_KRB5_Authenticator *val;
register int *error;
{
register krb5_authenticator *retval;
krb5_checksum *
KRB5_Checksum2krb5_checksum(val, error)
-const register struct type_KRB5_Checksum *val;
+register const struct type_KRB5_Checksum *val;
register int *error;
{
krb5_checksum *retval;
krb5_cred *
KRB5_KRB__CRED2krb5_cred(val, error)
-const register struct type_KRB5_KRB__CRED *val;
+register const struct type_KRB5_KRB__CRED *val;
register int *error;
{
register krb5_cred *retval;
krb5_cred_enc_part *
KRB5_EncKrbCredPart2krb5_cred_enc_part(val, error)
-const register struct type_KRB5_EncKrbCredPart *val;
+register const struct type_KRB5_EncKrbCredPart *val;
register int *error;
{
register krb5_cred_enc_part *retval;
retval->ticket_info = (krb5_cred_info **)
xcalloc(i + 1, sizeof(*retval->ticket_info));
if (!retval->ticket_info) {
- nomem:
*error = ENOMEM;
+ krb5_xfree(retval);
return(0);
}
retval->nonce = 0;
if (val->timestamp) {
+ if (!(val->optionals & opt_KRB5_EncKrbPrivPart_usec)) {
+ /* must have usec if we have timestamp */
+ *error = ISODE_50_LOCAL_ERR_BADCOMBO;
+ goto errout;
+ }
+
retval->timestamp = gentime2unix(val->timestamp, error);
if (*error) {
errout:
krb5_free_cred_enc_part(retval);
return(0);
}
+ retval->usec = val->usec;
+ } else {
+ retval->timestamp = 0;
+ retval->usec = 0;
}
-
- if (val->optionals & opt_KRB5_EncKrbCredPart_usec)
- retval->usec = val->usec;
- else
- retval->timestamp = 0;
-
+
if (val->s__address) {
retval->s_address =
KRB5_HostAddress2krb5_addr(val->s__address,
retval->ticket_info[i] = (krb5_cred_info *)
xmalloc(sizeof(*retval->ticket_info[i]));
if (!retval->ticket_info[i]) {
- krb5_free_cred_enc_part(retval);
- goto nomem;
+ *error = ENOMEM;
+ goto errout;
}
xbzero((char *)retval->ticket_info[i],
sizeof(*retval->ticket_info[i]));
krb5_enc_data *
KRB5_EncryptedData2krb5_enc_data(val, error)
-const register struct type_KRB5_EncryptedData *val;
+register const struct type_KRB5_EncryptedData *val;
register int *error;
{
register krb5_enc_data *retval;
krb5_enc_kdc_rep_part *
KRB5_EncKDCRepPart2krb5_enc_kdc_rep_part(val, error)
-const register struct type_KRB5_EncKDCRepPart *val;
+register const struct type_KRB5_EncKDCRepPart *val;
register int *error;
{
register krb5_enc_kdc_rep_part *retval;
krb5_keyblock *
KRB5_EncryptionKey2krb5_keyblock(val, error)
-const register struct type_KRB5_EncryptionKey *val;
+register const struct type_KRB5_EncryptionKey *val;
register int *error;
{
krb5_keyblock *retval;
krb5_error *
KRB5_KRB__ERROR2krb5_error(val, error)
-const register struct type_KRB5_KRB__ERROR *val;
+register const struct type_KRB5_KRB__ERROR *val;
register int *error;
{
register krb5_error *retval;
krb5_enc_tkt_part *
KRB5_EncTicketPart2krb5_enc_tkt_part(val, error)
-const register struct type_KRB5_EncTicketPart *val;
+register const struct type_KRB5_EncTicketPart *val;
register int *error;
{
register krb5_enc_tkt_part *retval;
struct type_KRB5_AP__REP *
krb5_ap_rep2KRB5_AP__REP(val, error)
-const register krb5_ap_rep *val;
+register const krb5_ap_rep *val;
register int *error;
{
register struct type_KRB5_AP__REP *retval;
struct type_KRB5_AP__REQ *
krb5_ap_req2KRB5_AP__REQ(val, error)
-const register krb5_ap_req *val;
+register const krb5_ap_req *val;
register int *error;
{
register struct type_KRB5_AP__REQ *retval;
struct type_KRB5_EncAPRepPart *
krb5_ap_rep_enc_part2KRB5_EncAPRepPart(val, error)
-const register krb5_ap_rep_enc_part *val;
+register const krb5_ap_rep_enc_part *val;
register int *error;
{
register struct type_KRB5_EncAPRepPart *retval;
struct type_KRB5_Authenticator *
krb5_authenticator2KRB5_Authenticator(val, error)
-const register krb5_authenticator *val;
+register const krb5_authenticator *val;
register int *error;
{
register struct type_KRB5_Authenticator *retval;
struct type_KRB5_KRB__CRED *
krb5_cred2KRB5_KRB__CRED(val, error)
-const register krb5_cred *val;
+register const krb5_cred *val;
register int *error;
{
register struct type_KRB5_KRB__CRED *retval;
struct type_KRB5_EncKrbCredPart *
krb5_cred_enc_part2KRB5_EncKrbCredPart(val, error)
-const register krb5_cred_enc_part *val;
+register const krb5_cred_enc_part *val;
register int *error;
{
struct type_KRB5_EncKrbCredPart *retval = 0;
}
for (i = 0, rv = val; rv; rv = rv->next, i++) {
if (qb_pullup(rv->PA__DATA->pa__data) != OK) {
- krb5_xfree(retval);
+ retval[i] = 0;
+ krb5_free_pa_data(retval);
*error = ENOMEM;
return(0);
}
krb5_kdc_rep *
KRB5_KDC__REP2krb5_kdc_rep(val, error)
-const register struct type_KRB5_TGS__REP *val;
+register const struct type_KRB5_TGS__REP *val;
register int *error;
{
register krb5_kdc_rep *retval;
val->crealm,
error);
if (!retval->client) {
- krb5_xfree(retval);
+ krb5_free_kdc_rep(retval);
return(0);
}
krb5_kdc_rep *
KRB5_KDC__REP2krb5_tgs_rep(val, error)
-const register struct type_KRB5_TGS__REP *val;
+register const struct type_KRB5_TGS__REP *val;
register int *error;
{
return KRB5_KDC__REP2krb5_kdc_rep(val, error);
struct type_KRB5_EncryptedData *
krb5_enc_data2KRB5_EncryptedData(val, error)
-const register krb5_enc_data *val;
+register const krb5_enc_data *val;
register int *error;
{
register struct type_KRB5_EncryptedData *retval;
struct type_KRB5_EncKDCRepPart *
krb5_enc_kdc_rep_part2KRB5_EncKDCRepPart(val, error)
-const register krb5_enc_kdc_rep_part *val;
+register const krb5_enc_kdc_rep_part *val;
register int *error;
{
register struct type_KRB5_EncKDCRepPart *retval;
struct type_KRB5_KRB__ERROR *
krb5_error2KRB5_KRB__ERROR(val, error)
-const register krb5_error *val;
+register const krb5_error *val;
register int *error;
{
register struct type_KRB5_KRB__ERROR *retval;
struct type_KRB5_EncTicketPart *
krb5_enc_tkt_part2KRB5_EncTicketPart(val, error)
-const register krb5_enc_tkt_part *val;
+register const krb5_enc_tkt_part *val;
register int *error;
{
register struct type_KRB5_EncTicketPart *retval;
}
struct type_KRB5_TGS__REP *
-krb5_kdc_rep2KRB5_KDC__REP(DECLARG(const register krb5_kdc_rep *,val),
+krb5_kdc_rep2KRB5_KDC__REP(DECLARG(register const krb5_kdc_rep *,val),
DECLARG(register int *,error))
-OLDDECLARG(const register krb5_kdc_rep *,val)
+OLDDECLARG(register const krb5_kdc_rep *,val)
OLDDECLARG(register int *,error)
{
register struct type_KRB5_TGS__REP *retval;
struct type_KRB5_EncKrbPrivPart *
krb5_priv_enc_part2KRB5_EncKrbPrivPart(val, error)
-const register krb5_priv_enc_part *val;
+register const krb5_priv_enc_part *val;
register int *error;
{
register struct type_KRB5_EncKrbPrivPart *retval;
struct type_KRB5_KRB__PRIV *
krb5_priv2KRB5_KRB__PRIV(val, error)
-const register krb5_priv *val;
+register const krb5_priv *val;
register int *error;
{
register struct type_KRB5_KRB__PRIV *retval;
struct type_KRB5_PasswdSequence *
krb5_pwd_seq2KRB5_PWD__SEQ(val, error)
-const register passwd_phrase_element *val;
+register const passwd_phrase_element *val;
register int *error;
{
register struct type_KRB5_PasswdSequence *retval;
struct type_KRB5_KRB__SAFE *
krb5_safe2KRB5_KRB__SAFE(val, error)
-const register krb5_safe *val;
+register const krb5_safe *val;
register int *error;
{
register struct type_KRB5_KRB__SAFE *retval;
struct type_KRB5_KDC__REQ__BODY *
krb5_kdc_req2KRB5_KDC__REQ__BODY(val, error)
-const register krb5_kdc_req *val;
+register const krb5_kdc_req *val;
register int *error;
{
register struct type_KRB5_KDC__REQ__BODY *retval;
struct type_KRB5_KDC__REQ *
krb5_kdc_req2KRB5_KDC__REQ(val, error)
-const register krb5_kdc_req *val;
+register const krb5_kdc_req *val;
register int *error;
{
register struct type_KRB5_KDC__REQ *retval;
struct type_KRB5_TGS__REP *
krb5_tgs_rep2KRB5_KDC__REP(val, error)
-const register krb5_kdc_rep *val;
+register const krb5_kdc_rep *val;
register int *error;
{
return (struct type_KRB5_TGS__REP *)
struct type_KRB5_Ticket *
krb5_ticket2KRB5_Ticket(val, error)
-const register krb5_ticket *val;
+register const krb5_ticket *val;
register int *error;
{
register struct type_KRB5_Ticket *retval;
struct type_KRB5_TransitedEncoding *
krb5_transited2KRB5_TransitedEncoding(val, error)
-const register krb5_transited *val;
+register const krb5_transited *val;
register int *error;
{
register struct type_KRB5_TransitedEncoding *retval;
krb5_priv_enc_part *
KRB5_EncKrbPrivPart2krb5_priv_enc_part(val, error)
-const register struct type_KRB5_EncKrbPrivPart *val;
+register const struct type_KRB5_EncKrbPrivPart *val;
register int *error;
{
register krb5_priv_enc_part *retval;
for (i = 1, rv = val->name__string; rv->next; i++, rv = rv->next)
;
- /* plus one for the realm */
retval->length = i;
retval->data = (krb5_data *)malloc(i * sizeof(krb5_data));
if (retval->data == 0) {
while (--i >= 0)
free(krb5_princ_component(retval, i)->data);
*error = ENOMEM;
+ if (retval->realm.data)
+ krb5_xfree(retval->realm.data);
+ krb5_xfree(retval->data);
+ krb5_xfree(retval);
return(0);
}
return(retval);
krb5_priv *
KRB5_KRB__PRIV2krb5_priv(val, error)
-const register struct type_KRB5_KRB__PRIV *val;
+register const struct type_KRB5_KRB__PRIV *val;
register int *error;
{
register krb5_priv *retval;
passwd_phrase_element *
KRB5_PWD__SEQ2krb5_pwd_seq(val, error)
-const register struct type_KRB5_PasswdSequence *val;
+register const struct type_KRB5_PasswdSequence *val;
register int *error;
{
register passwd_phrase_element *retval;
krb5_pwd_data *
KRB5_PWD__DATA2krb5_pwd_data(val, error)
-const register struct type_KRB5_PasswdData *val;
+register const struct type_KRB5_PasswdData *val;
register int *error;
{
register krb5_pwd_data *retval;
krb5_safe *
KRB5_KRB__SAFE2krb5_safe(val, error)
-const register struct type_KRB5_KRB__SAFE *val;
+register const struct type_KRB5_KRB__SAFE *val;
register int *error;
{
register krb5_safe *retval;
krb5_kdc_req *
KRB5_KDC__REQ__BODY2krb5_kdc_req(val, error)
-const register struct type_KRB5_KDC__REQ__BODY *val;
+register const struct type_KRB5_KDC__REQ__BODY *val;
register int *error;
{
register krb5_kdc_req *retval;
krb5_kdc_req *
KRB5_KDC__REQ2krb5_kdc_req(val, error)
-const register struct type_KRB5_KDC__REQ *val;
+register const struct type_KRB5_KDC__REQ *val;
register int *error;
{
register krb5_kdc_req *retval;
krb5_ticket *
KRB5_Ticket2krb5_ticket(val, error)
-const register struct type_KRB5_Ticket *val;
+register const struct type_KRB5_Ticket *val;
register int *error;
{
register krb5_ticket *retval;
krb5_transited *
KRB5_TransitedEncoding2krb5_transited(val, error)
-const register struct type_KRB5_TransitedEncoding *val;
+register const struct type_KRB5_TransitedEncoding *val;
register int *error;
{
register krb5_transited *retval;