asn1_encode.c revision 159d09a20817016f09b3ea28d1bdada4a336bb91
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
*
* Copyright 1994 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*/
/* ASN.1 primitive encoders */
#include "asn1_encode.h"
#include "asn1_make.h"
unsigned int *retlen)
{
unsigned int length = 0;
long valcopy;
int digit;
do {
length++;
length++;
length++;
}
return 0;
}
unsigned int *retlen)
{
unsigned int length = 0;
unsigned int partlen;
return 0;
}
unsigned int *retlen)
{
unsigned int length = 0;
unsigned int partlen;
return 0;
}
unsigned int *retlen)
{
unsigned int length = 0;
unsigned int partlen;
unsigned long valcopy;
int digit;
do {
length++;
length++;
}
return 0;
}
const asn1_octet *val,
unsigned int *retlen)
{
unsigned int length;
return 0;
}
const asn1_octet *val,
unsigned int *retlen)
{
unsigned int length;
return 0;
}
{
unsigned int length;
return 0;
}
{
*retlen = 2;
return 0;
}
{
unsigned int length;
return 0;
}
{
unsigned int length;
return 0;
}
unsigned int *retlen)
{
char s[16], *sp;
/*
* Time encoding: YYYYMMDDhhmmssZ
*/
if (gmt_time == 0) {
sp = "19700101000000Z";
} else {
/*
* Sanity check this just to be paranoid, as gmtime can return NULL,
* and some bogus implementations might overrun on the sprintf.
*/
#ifdef HAVE_GMTIME_R
# ifdef GMTIME_R_RETURNS_INT
return ASN1_BAD_GMTIME;
# else
return ASN1_BAD_GMTIME;
# endif
#else
return ASN1_BAD_GMTIME;
#endif
return ASN1_BAD_GMTIME;
sprintf(s, "%04d%02d%02d%02d%02d%02dZ",
sp = s;
}
sum = 15;
return 0;
}
const char *val,
unsigned int *retlen)
{
unsigned int length;
&length);
return 0;
}