~ubuntu-branches/ubuntu/lucid/openssl/lucid-proposed

« back to all changes in this revision

Viewing changes to crypto/asn1/t_x509.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2009-06-13 18:15:46 UTC
  • mto: (11.1.5 squeeze)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20090613181546-vbfntai3b009dl1u
Tags: upstream-0.9.8k
ImportĀ upstreamĀ versionĀ 0.9.8k

Show diffs side-by-side

added added

removed removed

Lines of Context:
332
332
int ASN1_STRING_print(BIO *bp, ASN1_STRING *v)
333
333
        {
334
334
        int i,n;
335
 
        char buf[80],*p;;
 
335
        char buf[80],*p;
336
336
 
337
337
        if (v == NULL) return(0);
338
338
        n=0;
393
393
        d= (v[6]-'0')*10+(v[7]-'0');
394
394
        h= (v[8]-'0')*10+(v[9]-'0');
395
395
        m=  (v[10]-'0')*10+(v[11]-'0');
396
 
        if (    (v[12] >= '0') && (v[12] <= '9') &&
397
 
                (v[13] >= '0') && (v[13] <= '9'))
 
396
        if (tm->length >= 14 &&
 
397
            (v[12] >= '0') && (v[12] <= '9') &&
 
398
            (v[13] >= '0') && (v[13] <= '9'))
398
399
                s=  (v[12]-'0')*10+(v[13]-'0');
399
400
 
400
401
        if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",
428
429
        d= (v[4]-'0')*10+(v[5]-'0');
429
430
        h= (v[6]-'0')*10+(v[7]-'0');
430
431
        m=  (v[8]-'0')*10+(v[9]-'0');
431
 
        if (    (v[10] >= '0') && (v[10] <= '9') &&
432
 
                (v[11] >= '0') && (v[11] <= '9'))
 
432
        if (tm->length >=12 &&
 
433
            (v[10] >= '0') && (v[10] <= '9') &&
 
434
            (v[11] >= '0') && (v[11] <= '9'))
433
435
                s=  (v[10]-'0')*10+(v[11]-'0');
434
436
 
435
437
        if (BIO_printf(bp,"%s %2d %02d:%02d:%02d %d%s",
449
451
 
450
452
        l=80-2-obase;
451
453
 
452
 
        b=s=X509_NAME_oneline(name,NULL,0);
453
 
        if (!*s)
 
454
        b=X509_NAME_oneline(name,NULL,0);
 
455
        if (!*b)
454
456
                {
455
457
                OPENSSL_free(b);
456
458
                return 1;
457
459
                }
458
 
        s++; /* skip the first slash */
 
460
        s=b+1; /* skip the first slash */
459
461
 
460
462
        c=s;
461
463
        for (;;)
480
482
                        {
481
483
                        i=s-c;
482
484
                        if (BIO_write(bp,c,i) != i) goto err;
483
 
                        c+=i;
484
 
                        c++;
 
485
                        c=s+1;  /* skip following slash */
485
486
                        if (*s != '\0')
486
487
                                {
487
488
                                if (BIO_write(bp,", ",2) != 2) goto err;
502
503
        OPENSSL_free(b);
503
504
        return(ret);
504
505
        }
505