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

« back to all changes in this revision

Viewing changes to crypto/x509/x509_cmp.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:
288
288
                        if (!(nabit & STR_TYPE_CMP) ||
289
289
                                !(nbbit & STR_TYPE_CMP))
290
290
                                return j;
291
 
                        j = asn1_string_memcmp(na->value, nb->value);
 
291
                        if (!asn1_string_memcmp(na->value, nb->value))
 
292
                                j = 0;
292
293
                        }
293
294
                else if (na->value->type == V_ASN1_PRINTABLESTRING)
294
295
                        j=nocase_spacenorm_cmp(na->value, nb->value);
322
323
        {
323
324
        unsigned long ret=0;
324
325
        unsigned char md[16];
 
326
        EVP_MD_CTX md_ctx;
325
327
 
326
328
        /* Make sure X509_NAME structure contains valid cached encoding */
327
329
        i2d_X509_NAME(x,NULL);
328
 
        EVP_Digest(x->bytes->data, x->bytes->length, md, NULL, EVP_md5(), NULL);
 
330
        EVP_MD_CTX_init(&md_ctx);
 
331
        EVP_MD_CTX_set_flags(&md_ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
 
332
        EVP_DigestInit_ex(&md_ctx, EVP_md5(), NULL);
 
333
        EVP_DigestUpdate(&md_ctx, x->bytes->data, x->bytes->length);
 
334
        EVP_DigestFinal_ex(&md_ctx,md,NULL);
 
335
        EVP_MD_CTX_cleanup(&md_ctx);
329
336
 
330
337
        ret=(   ((unsigned long)md[0]     )|((unsigned long)md[1]<<8L)|
331
338
                ((unsigned long)md[2]<<16L)|((unsigned long)md[3]<<24L)