MCPcopy Create free account
hub / github.com/antonioCoco/RogueWinRM / ASNDerWriteToken

Function ASNDerWriteToken

spnegotokenhandler/derparse.c:591–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589////////////////////////////////////////////////////////////////////////////
590
591int ASNDerWriteToken(unsigned char* pbData, unsigned char ucType,
592 unsigned char* pbTokenValue, long nLength)
593{
594 int nTotalBytesWrittenOut = 0L;
595 int nNumLengthBytesWritten = 0L;
596
597 // Write out the type
598 *pbData = ucType;
599
600 // Wrote 1 byte, and move data pointer
601 nTotalBytesWrittenOut++;
602 pbData++;
603
604 // Now write out the length and adjust the number of bytes written out
605 nNumLengthBytesWritten = ASNDerWriteLength(pbData, nLength);
606
607 nTotalBytesWrittenOut += nNumLengthBytesWritten;
608 pbData += nNumLengthBytesWritten;
609
610 // Write out the token value if we got one. The assumption is that the
611 // nLength value indicates how many bytes are in pbTokenValue.
612
613 if (NULL != pbTokenValue)
614 {
615 memcpy(pbData, pbTokenValue, nLength);
616 nTotalBytesWrittenOut += nLength;
617 }
618
619 return nTotalBytesWrittenOut;
620}
621
622
623/////////////////////////////////////////////////////////////////////////////

Callers 4

CreateSpnegoInitTokenFunction · 0.85
CreateSpnegoTargTokenFunction · 0.85
ASNDerWriteMechListFunction · 0.85
ASNDerWriteElementFunction · 0.85

Calls 1

ASNDerWriteLengthFunction · 0.85

Tested by

no test coverage detected