unsigned pathlen

This commit is contained in:
Stanislav Klima
2022-07-13 09:07:02 +02:00
parent 26a62b4b9e
commit 1b6ce6150e
2 changed files with 5 additions and 5 deletions

View File

@ -22751,10 +22751,10 @@ static int SetExtensionsHeader(byte* out, word32 outSz, int extSz)
/* encode CA basic constraints true with path length
* return total bytes written */
static int SetCaWithPathLen(byte* out, word32 outSz, char pathLen)
static int SetCaWithPathLen(byte* out, word32 outSz, byte pathLen)
{
/* ASN1->DER sequence for Basic Constraints True and path length */
byte caPathLenBasicConstASN1[] = {
const byte caPathLenBasicConstASN1[] = {
0x30, 0x0F, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04,
0x08, 0x30, 0x06, 0x01, 0x01, 0xFF, 0x02, 0x01,
0x00
@ -22766,10 +22766,10 @@ static int SetCaWithPathLen(byte* out, word32 outSz, char pathLen)
if (outSz < sizeof(caPathLenBasicConstASN1))
return BUFFER_E;
caPathLenBasicConstASN1[16U] = pathLen;
XMEMCPY(out, caPathLenBasicConstASN1, sizeof(caPathLenBasicConstASN1));
out[sizeof(caPathLenBasicConstASN1)-1] = pathLen;
return (int)sizeof(caPathLenBasicConstASN1);
}

View File

@ -384,7 +384,7 @@ typedef struct Cert {
int selfSigned; /* self signed flag */
CertName subject; /* subject info */
int isCA; /* is this going to be a CA */
char pathLen; /* max depth of valid certification
byte pathLen; /* max depth of valid certification
* paths that include this cert */
/* internal use only */
int bodySz; /* pre sign total size */