list both des-cbc-crc and des-cbc-md5 entries
This commit is contained in:
@@ -212,9 +212,17 @@ akf_start_seq_get(krb5_context context,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c->data = NULL;
|
||||||
c->sp = krb5_storage_from_fd(c->fd);
|
c->sp = krb5_storage_from_fd(c->fd);
|
||||||
|
if (c->sp == NULL) {
|
||||||
|
close(c->fd);
|
||||||
|
krb5_clear_error_message (context);
|
||||||
|
return KRB5_KT_NOTFOUND;
|
||||||
|
}
|
||||||
|
krb5_storage_set_eof_code(c->sp, KRB5_KT_END);
|
||||||
|
|
||||||
ret = krb5_ret_uint32(c->sp, &d->num_entries);
|
ret = krb5_ret_uint32(c->sp, &d->num_entries);
|
||||||
if(ret) {
|
if(ret || d->num_entries > INT_MAX / 8) {
|
||||||
krb5_storage_free(c->sp);
|
krb5_storage_free(c->sp);
|
||||||
close(c->fd);
|
close(c->fd);
|
||||||
krb5_clear_error_message (context);
|
krb5_clear_error_message (context);
|
||||||
@@ -255,7 +263,10 @@ akf_next_entry(krb5_context context,
|
|||||||
|
|
||||||
entry->vno = kvno;
|
entry->vno = kvno;
|
||||||
|
|
||||||
|
if (cursor->data)
|
||||||
entry->keyblock.keytype = ETYPE_DES_CBC_MD5;
|
entry->keyblock.keytype = ETYPE_DES_CBC_MD5;
|
||||||
|
else
|
||||||
|
entry->keyblock.keytype = ETYPE_DES_CBC_CRC;
|
||||||
entry->keyblock.keyvalue.length = 8;
|
entry->keyblock.keyvalue.length = 8;
|
||||||
entry->keyblock.keyvalue.data = malloc (8);
|
entry->keyblock.keyvalue.data = malloc (8);
|
||||||
if (entry->keyblock.keyvalue.data == NULL) {
|
if (entry->keyblock.keyvalue.data == NULL) {
|
||||||
@@ -277,7 +288,11 @@ akf_next_entry(krb5_context context,
|
|||||||
entry->aliases = NULL;
|
entry->aliases = NULL;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
if (cursor->data) {
|
||||||
krb5_storage_seek(cursor->sp, pos + 4 + 8, SEEK_SET);
|
krb5_storage_seek(cursor->sp, pos + 4 + 8, SEEK_SET);
|
||||||
|
cursor->data = NULL;
|
||||||
|
} else
|
||||||
|
cursor->data = cursor;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,6 +303,7 @@ akf_end_seq_get(krb5_context context,
|
|||||||
{
|
{
|
||||||
krb5_storage_free(cursor->sp);
|
krb5_storage_free(cursor->sp);
|
||||||
close(cursor->fd);
|
close(cursor->fd);
|
||||||
|
cursor->data = NULL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user