*** empty log message ***

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1803 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-06-01 14:34:32 +00:00
parent 77e9073cca
commit 71646ad85b
2 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#include <krb5_locl.h>
RCSID("$Id$");
krb5_error_code
krb5_generate_seq_number(krb5_context context,
const krb5_keyblock *key,
int32_t *seqno)
{
des_cblock c;
int32_t q;
u_char *p;
int i;
if (key->keytype != KEYTYPE_DES)
abort ();
memmove (c, key->contents.data, sizeof(c));
des_new_random_key(&c);
q = 0;
for (p = (u_char *)c, i = 0; i < sizeof(c); ++i, ++p)
q = (q << 8) | *p;
q &= 0xffffffff;
*seqno = q;
return 0;
}