Using int for the digest length in EVP_DigestFinal() broke some compilers.
authorDr. Stephen Henson <steve@openssl.org>
Sun, 14 Mar 1999 13:31:42 +0000 (13:31 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 14 Mar 1999 13:31:42 +0000 (13:31 +0000)
Changed to unsigned int: also need an evil cast in pk7_doit.c because a
signed, unsigned comparison chokes VC++.

crypto/pkcs7/pk7_doit.c
crypto/x509v3/v3_skey.c

index 2e27f7d3daad41a62ef9fd14d58ae106cb77e8d9..88229c08ba8ac8c6ee7dfc80a90b914bb5dac38c 100644 (file)
@@ -721,7 +721,7 @@ PKCS7_SIGNER_INFO *si;
        if ((sk != NULL) && (sk_num(sk) != 0))
                {
                unsigned char md_dat[EVP_MAX_MD_SIZE];
-                int md_len;
+                unsigned int md_len;
                ASN1_OCTET_STRING *message_digest;
 
                EVP_DigestFinal(&mdc_tmp,md_dat,&md_len);
@@ -731,7 +731,7 @@ PKCS7_SIGNER_INFO *si;
                        PKCS7err(PKCS7_F_PKCS7_DATAVERIFY,PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST);
                        goto err;
                        }
-               if ((message_digest->length != md_len) ||
+               if ((message_digest->length != (int)md_len) ||
                        (memcmp(message_digest->data,md_dat,md_len)))
                        {
 #if 0
index 20c9c2c5e31d3e46fbaf672d0e1a9bff49ac65b5..e725d6630c039334a3ed926cea52beb967324e5d 100644 (file)
@@ -124,7 +124,7 @@ char *str;
        ASN1_BIT_STRING *pk;
        unsigned char pkey_dig[EVP_MAX_MD_SIZE];
        EVP_MD_CTX md;
-       int diglen;
+       unsigned int diglen;
 
        if(strcmp(str, "hash")) return s2i_ASN1_OCTET_STRING(method, ctx, str);