#pragma ident "%Z%%M% %I% %E% SMI"
/* ... copyright ... */
/* Novell key-format scheme:
KrbKeySet ::= SEQUENCE {
attribute-major-vno [0] UInt16,
attribute-minor-vno [1] UInt16,
kvno [2] UInt32,
mkvno [3] UInt32 OPTIONAL,
keys [4] SEQUENCE OF KrbKey,
...
}
KrbKey ::= SEQUENCE {
salt [0] KrbSalt OPTIONAL,
key [1] EncryptionKey,
s2kparams [2] OCTET STRING OPTIONAL,
...
}
KrbSalt ::= SEQUENCE {
type [0] Int32,
salt [1] OCTET STRING OPTIONAL
}
EncryptionKey ::= SEQUENCE {
keytype [0] Int32,
keyvalue [1] OCTET STRING
}
*/
#include <k5-int.h>
#include <kdb.h>
#include "krbasn1.h"
#include "asn1_encode.h"
#include "asn1_decode.h"
#include "asn1_make.h"
#include "asn1_get.h"
{ \
goto last; \
}
#define checkerr \
if (ret != 0) \
goto last
/************************************************************************/
/* Encode the Principal's keys */
/************************************************************************/
static asn1_error_code
unsigned int *retlen)
{
/* Encode the key type and value. */
{
unsigned int key_len = 0;
/* key value */
/* key type */
}
/* Encode the salt type and value (optional) */
unsigned int salt_len = 0;
/* salt value (optional) */
}
/* salt type */
}
last:
return ret;
}
/* Major version and minor version are both '1' - first version */
/* asn1_error_code asn1_encode_sequence_of_keys (krb5_key_data *key_data, */
{
unsigned long tmp_ul;
/* Allocate the buffer */
/* Sequence of keys */
{
int i;
unsigned int seq_len = 0;
for (i = n_key_data - 1; i >= 0; i--) {
}
}
/* mkvno */
if (mkvno < 0)
/* kvno (assuming all keys in array have same version) */
if (key_data[0].key_data_kvno < 0)
/* attribute-minor-vno == 1 */
/* attribute-major-vno == 1 */
/* The reverse encoding is straightened out here */
last:
asn1buf_destroy (&buf);
}
return ret;
}
/************************************************************************/
/* Decode the Principal's keys */
/************************************************************************/
cleanup (ASN1_BAD_LENGTH); \
static asn1_error_code
{
int buflen;
taginfo t;
/* Work on a copy of 'buf' */
if (t.tagnum != expectedtag)
last:
return ret;
}
#if 0 /* not currently used */
static asn1_error_code
{
int buflen;
asn1_error_code ret = 0;
taginfo t;
/* Work on a copy of 'buf' */
if (t.tagnum != expectedtag)
last:
return ret;
}
#endif
static asn1_error_code
{
int buflen;
taginfo t;
/* Work on a copy of 'buf' */
if (t.tagnum != expectedtag)
last:
return ret;
}
{
unsigned int length;
taginfo t;
asn1_get_tag_2(&subbuf, &t);
/* Salt */
if (t.tagnum == 0) {
int buflen;
unsigned long keytype;
unsigned int keylen;
}
} else
/* Key */
{
int buflen;
long lval;
unsigned int ival;
if (t.tagnum != 1)
}
last:
if (ret != 0) {
}
}
}
return ret;
}
/* asn1_error_code asn1_decode_sequence_of_keys (krb5_data *in, */
krb5_key_data **out,
int *mkvno)
{
int seqindef;
unsigned int length;
taginfo t;
long lval;
*n_key_data = 0;
/* attribute-major-vno */
/* attribute-minor-vno */
/* kvno (assuming all keys in array have same version) */
/* mkvno (optional) */
/* Sequence of keys */
{
int i, buflen;
if (t.tagnum != 4)
(*n_key_data)++;
if (asn1buf_remains(&keyseq, 0) == 0)
break; /* Not freeing the last key structure */
}
}
/*
* There could be other data inside the outermost sequence ... tags we don't
* know about. So, not invoking "safe_syncbuf(&buf,&subbuf)"
*/
last:
if (ret != 0) {
int i;
for (i = 0; i < *n_key_data; i++) {
}
}
return ret;
}