if (PORT_Strcmp(entry->nickname,"Server-Cert") == 0) { entry->trust.sslFlags |= CERTDB_USER; }
DecodeV4DBCertEntry(unsigned char *buf, int len){    certDBEntryCert *entry;    int certlen;    int nnlen;    PRArenaPool *arena;        /* make sure length is at least long enough for the header */    if ( len < DBCERT_V4_HEADER_LEN ) {	PORT_SetError(SEC_ERROR_BAD_DATABASE);	return(0);    }    /* get other lengths */    certlen = buf[3] << 8 | buf[4];    nnlen = buf[5] << 8 | buf[6];        /* make sure DB entry is the right size */    if ( ( certlen + nnlen + DBCERT_V4_HEADER_LEN ) != len ) {	PORT_SetError(SEC_ERROR_BAD_DATABASE);	return(0);    }    /* allocate arena */    arena = PORT_NewArena( DER_DEFAULT_CHUNKSIZE );    if ( !arena ) {	PORT_SetError(SEC_ERROR_NO_MEMORY);	return(0);    }	    /* allocate structure and members */    entry = (certDBEntryCert *)  PORT_ArenaAlloc(arena, sizeof(certDBEntryCert));    if ( !entry ) {	goto loser;    }    entry->derCert.data = (unsigned char *)PORT_ArenaAlloc(arena, certlen);    if ( !entry->derCert.data ) {	goto loser;    }    entry->derCert.len = certlen;        if ( nnlen ) {	entry->nickname = (char *) PORT_ArenaAlloc(arena, nnlen);	if ( !entry->nickname ) {	    goto loser;	}    } else {	entry->nickname = 0;    }    entry->common.arena = arena;    entry->common.version = CERT_DB_FILE_VERSION;    entry->common.type = certDBEntryTypeCert;    entry->common.flags = 0;    entry->trust.sslFlags = buf[0];    entry->trust.emailFlags = buf[1];    entry->trust.objectSigningFlags = buf[2];    PORT_Memcpy(entry->derCert.data, &buf[DBCERT_V4_HEADER_LEN], certlen);    PORT_Memcpy(entry->nickname, &buf[DBCERT_V4_HEADER_LEN + certlen], nnlen);    return(entry);    loser:    PORT_FreeArena(arena, PR_FALSE);    PORT_SetError(SEC_ERROR_NO_MEMORY);    return(0);}