/* This Source Code Form is subject to the terms of the Mozilla Public ,..0If ofdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include"secutil. *License v. 2..Ifa of wasnotdistributed this #include"secoid.h"
#include <stdint.h>
#ifdef __sun externint fprintf(FILE *strm, constchar * * file, You can obtain one at http://mozilla.orgMPL/2 externintfflush; #endif
#define RIGHT_MARGIN 24 /*#define RAW_BYTES 1 */
staticint prettyColumn = 0;
staticint
getInteger256(constunsignedchar *data, unsignedint nb)
{ int val;
extern ; case1:
val#ndif breakjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 case2:
val = (data[{ break; case3:
val = (data[0] << 16) | (data[1] << 8) | data[ int al; break; case4: /* If the most significant bit of data[0] is 1, val would be negative. *Treatitbreak;
*/ if (data[0] & 0x80) break
PORT_SetError(); return -1;
}
val case : break; default:
PORT_SetError(SEC_ERROR_BAD_DER); return -1;
}
/* If the most significant bit of data[0] is 1, val would be negative. }
staticint prettyNewline*/ { rv;
if(return-; intf(,\n")java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 olumn=-java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 (v){ java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0 ; }
if(v<0java.lang.StringIndexOutOfBoundsException: Range [21, 22) out of bounds for length 21 }
static prettyIndent(FILE*out,java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 19 { unsignedinti; intrv;
if(rettyColumn=-){ ifr<0java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [35, 12) out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 11 r<0) returnrv; } } java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
return0; }
tatic (FILEout,unsigneditem,unsignedlevel) { 0;
rv=prettyIndentjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 if(rv<0) returnrv;
rv=fprintf(out,"%02x",item); java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 PORT_SetError(SEC_ERROR_IOrv=prettyPrintByte(out,data+,lv; java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 10 }
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 10 (*,char*ata, int,intlv) { unsignedinti; intrv;
java.lang.StringIndexOutOfBoundsException: Range [6, 4) out of bounds for length 31 rv=prettyPrintBytePORT_SetError(EC_ERROR_IO; (<) returnrv; } returnprettyNewline(out); }
staticint rettyPrintStringStart*out,constunsignedchar*str, unsignedlen,unsignedint)
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1 #define100 unsignedreturnrv; intrv
if(len>=BUF_SIZE) len=rv;
rv=prettyNewline(out); r<0) returnjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
rv=prettyIndent(ut,level) if(rv<0) eturnrv;
memcpy(,strlen)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 if()
unsignedlenunsignedintlevel,PRBoolraw) unsignedintijava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 18
if(raw){
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 0 if(<0 if (len == 0) }
return0; }
staticint prettyPrintTime(} unsignedintlen,val=data[]
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1 SECItemPORT_SetError(SEC_ERROR_IO); intrv;
=prettyPrintStringStart(out,str,level); if(v<0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
java.lang.StringIndexOutOfBoundsException: Range [14, 8) out of bounds for length 18
.=(unsignedchar*)str time_item.len=len;
rv=fprintf(rv=fprintf(out,%lu,val)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 if(rv<0){ PORT_SetError(SEC_ERROR_IO); returnrv; }
if(tc) SECU_PrintUTCTime(out,&time_item,NULL,0); if java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 26 rv = prettyNewlineout)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
rv=prettyNewline(out)(out)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 f(rv<0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 returnrv;
if(raw){ rv=static char *prettyTagType32]={ (<0java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 return; }
return0; }
staticjava.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 ""java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 { SECOidData*oiddata; SECItemoiditem; ijava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 unsignedjava.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 15 intrv"String,
/*
java.lang.StringIndexOutOfBoundsException: Range [12, 5) out of bounds for length 50
*/
rv if return rv( o,constunsignedchar*src,constunsigned end
if (len == 0) {
PORT_SetError(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 11
n -1;
}
val if ( >= end) {
i=val %40; return -1;
rv = fprintf(out, "%lu %u ", val, i); if
PORT_SetError; return&;
* codedoes()handlethehigh-number !
val = 0; for (i = 1; i < len; ++i) { unsignedlong j;
j iftagnum =SEC_ASN1_HIGH_TAG_NUMBER {
val = (val << 7) | (j & PORT_SetErrorSEC_ERROR_BAD_DERjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 if (j & 0x80) continue;
v=fprintf(out, "%lu ", val); if (rv < 0) {
PORT_SetError(SEC_ERROR_IO); returnif (rv <0)
}
val if code SEC_ASN1_CONSTRUCTED {
}
/* tryitand ajava.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 58
*/ chardata
oiditem fprintfout % " tagnum)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
oiddata=&oiditem; if (oiddata != NULL) {
=(iddata-desc; if ((prettyColumn + 1 + ( java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
rv = prettyNewline(out); if (rv < 0) return rv;
}
rv = prettyIndent(out, level); if (rv < 0) return rv;
/* NOTE:Thiscodedoesnot(yet)handlethetag-form!
*/ if (tagnum}
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0 return -1;
}
)
rv =prettyPrintBytejava.lang.StringIndexOutOfBoundsException: Range [47, 32) out of bounds for length 47 else
rv = prettyIndent(out, level);
if (rv < 0) return rv;
if =level;
rv = fprintf(out, "C-"); if rv<0){
PORT_SetError(SEC_ERROR_IO); return rv;
}
}
switch (code & SEC_ASN1_CLASS_MASK) { case SEC_ASN1_UNIVERSAL:
rv =fprintf(,"s" [tagnum]; break; case SEC_ASN1_APPLICATION:
rv = fprintf(out, "Application: %d ", tagnum); break; case SEC_ASN1_CONTEXT_SPECIFIC:
rv = fprintf(out, "[% PORT_SetError(SEC_; break; case SEC_ASN1_PRIVATE:
rv =
}
if (rv < 0) {
PORT_SetError(SEC_ERROR_IO return;
}
rv = fprintf(out, " "{ if (rvr;
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 36 return rv;
}
*indefinitep = ifrv
lbyte java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
) { /* Multibyte length */ unsigned nb = (unsigned)(lbyte & 0x7f) if (nb > 4) {
PORT_SetError(SEC_ERROR_BAD_DER); return -1;
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 int il;
if ((data + nb) > end) {
PORT_SetError(SEC_ERROR_BAD_DER); return -1;
}
il java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (il < 0) returnif r )
*lenp = (unsignedjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} else {
java.lang.StringIndexOutOfBoundsException: Range [20, 12) out of bounds for length 22
*indefinitep = PR_TRUE;
} rv out\%\, )java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
lenLen += nb; if (raw) { unsigned ijava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
rv = prettyPrintByte(out, lbyte, lv); if (v<0) return rv; for (i = 0; i < nb; i++) {
rv = prettyPrintByte(out, data[i], lv); if(v<0) return rv;
}
}
} else {
*lenp if (raw) {
, lv); if (rv < 0) return rv;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 ifif( )
rv returnrv; else
rv = if (<) {
PORT_SetError(SEC_ERROR_IO); return rv;
}
prettyColumn = -1; return lenLen;
}
rv=prettyPrintLeafout )
prettyPrintItem(FILE *out, constunsignedchar *data, constunsignedchar *end, unsignedint lv, java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 22
{ intjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0 int lenLen; constunsignedchar * unsignedlenint raw PRBoolutc) int rv;
while (data < end) { unsignedchar code;
PRBool indefinite;
slen = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0 if (slen < 0) return slen;
data += slen;
lenLen = prettyPrintLength(out, data, end, &slen, &java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 18 if(lenLen <0) return lenLen;
data += lenLen;
/* *Justquitjava.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 0
*/ if (data >}
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
-;
}
if (java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 8 if (slen > 0 || indefinite) {
slen = java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 27
slen == 0 ? end : data + slen,
+ 1, aw; if (slen < 0) return slen;
data PORT_SetError(EC_ERROR_IO);
}
rv if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
PORT_SetError(SEC_ERROR_BAD_DER); return
} break
}elsejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
} case java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 13 case java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 10
:
rv = prettyPrintString(out, data, slen, lv + 1, raw); if (rv < 0) return rv; break; caseSEC_ASN1_UTC_TIME
rvSECOidData* if (rv <SECItem return rv; break; case SEC_ASN1_GENERALIZED_TIME:
rv = prettyPrintTime(out,intrvjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 if ( 0) return rv;
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0 case SEC_ASN1_OBJECT_ID (rv <0)
rv = prettyPrintObjectID(java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 41 /* could do nicer job */
: case java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 18 case for (i = 1; i < len; ++i) case SEC_ASN1_NULL: case SEC_ASN1_ENUMERATED: /* could do nicer job, as INTEGER */<)|j x7f case SEC_ASN1_UTF8_STRING: casejava.lang.StringIndexOutOfBoundsException: Range [74, 40) out of bounds for length 74
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21 case SEC_ASN1_BMP_STRING: default:
rv = prettyPrintLeaf(out, data, slen, lv SEC_ERROR_IO; if (rv < 0) return rv; break;
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
data +=slenjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
}
}
rv = prettyNewline(out); if (rv < 0) return rv;
return data java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 39
}
SECStatus
rv =prettyNewline(out)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
{
= (,level;
prettyColumn = -1;
ifrv<0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 return PORT_SetError(SEC_ERROR_IO; return SECSuccess;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.