/xmlbench/trunk

To get this branch, use:
bzr branch http://darksoft.org/webbzr/xmlbench/trunk

« back to all changes in this revision

Viewing changes to security/libxml1.c

  • Committer: Suren A. Chilingaryan
  • Date: 2009-10-08 03:17:59 UTC
  • Revision ID: csa@dside.dyndns.org-20091008031759-u5ys779huye7feni
LibXML Pull Parser, FAXPP Parser, Mono security benchmark, multiple fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#define crtfile "../ssl/test.crt"
29
29
 
30
30
xmlDocPtr               doc = 0;
 
31
xmlDocPtr               encDoc = 0;     // dummy for holding enc node
31
32
xmlSecKeysMngrPtr       keysMngr = 0; 
32
33
xmlSecKeysMngrPtr       vkeysMngr = 0; 
33
34
xmlSecDSigCtxPtr        dsigCtx = 0;
58
59
    xmlSecEncCtxDestroy(encCtx);
59
60
    xmlSecEncCtxDestroy(decCtx);
60
61
 
 
62
    xmlFreeDoc(encDoc);
 
63
    
 
64
 
61
65
    xmlSecCryptoShutdown();
62
66
    xmlSecCryptoAppShutdown();
63
67
    xmlSecShutdown();
74
78
    xmlNodePtr  node_k_em,node_k_cv,node_k_ki,node_k_kn;
75
79
    
76
80
 
 
81
        // DS: Unknown I/O error is here
77
82
    /* Init xmlsec library, could complain on I/O error, but works */
78
83
    if(xmlSecInit() < 0) {
79
84
        fprintf(stderr, "Error: xmlsec initialization failed.\n");
130
135
        exit(1);
131
136
    }                
132
137
 
 
138
    
133
139
    encCtx = xmlSecEncCtxCreate(vkeysMngr);
134
140
    if(encCtx == NULL) {
135
141
        fprintf(stderr, "Error: failed to create encryption context\n");
175
181
    }
176
182
 
177
183
 
 
184
    encDoc = xmlNewDoc("1.0");
 
185
 
178
186
        /* Creating encryption Node */
179
 
    enc = xmlSecTmplEncDataCreate(NULL, xmlSecTransformDes3CbcId, NULL, xmlSecTypeEncElement, NULL, NULL);
 
187
    enc = xmlSecTmplEncDataCreate(encDoc, xmlSecTransformDes3CbcId, NULL, xmlSecTypeEncElement, NULL, NULL);
180
188
    if(enc == NULL) {
181
189
        fprintf(stderr, "Error: EncryptedData node creation failed\n");
182
190
        exit(1);
269
277
    }              
270
278
 
271
279
/*    
272
 
    if (iter==td->iterations) {
 
280
    if (!iter) {
273
281
        xmlDocDumpMemory(doc,&mem,&memsize);
274
282
        puts(mem);
275
283
        free(mem);
326
334
    encCtx->encKey=skey;
327
335
 
328
336
/*
329
 
    if (iter==td->iterations) {
 
337
    if (!iter) {
330
338
        xmlDocDumpMemory(doc,&mem,&memsize);
331
339
        puts(mem);
332
340
        free(mem);
333
341
    }
334
342
*/
 
343
 
335
344
}
336
345
 
337
346
void decryptXML(struct TestData *td, unsigned long iter) { 
356
365
        exit(1);
357
366
    }              
358
367
/*
359
 
    if (iter==td->iterations) {
 
368
    if (!iter) {
360
369
        xmlDocDumpMemory(doc,&mem,&memsize);
361
370
        puts(mem);
362
371
        free(mem);