]> git.saurik.com Git - apple/security.git/blobdiff - libsecurity_cdsa_utils/lib/cuPem.cpp
Security-55471.14.8.tar.gz
[apple/security.git] / libsecurity_cdsa_utils / lib / cuPem.cpp
index 6675ef60e20a09fecf97b09d00c0b45352f0d143..94925b74e6c87d5fef3fb3eef4d2af0a288499a1 100644 (file)
@@ -105,11 +105,11 @@ int pemEncode(
        }
                
        /* estimate outsize - just be sloppy, way conservative */
-       unsigned outSize = encLen + (2 * strlen(headerString)) + 200;
+       size_t outSize = encLen + (2 * strlen(headerString)) + 200;
        *outData = (unsigned char *)malloc(outSize);
        sprintf((char *)*outData, "-----BEGIN %s-----\n%s-----END %s-----\n",
                headerString, (char *)enc, headerString);
-       *outDataLen = strlen((char *)*outData);
+       *outDataLen = (unsigned int)strlen((char *)*outData);
 
        if((*outData)[*outDataLen - 1] == '\0') {
                (*outDataLen)--;
@@ -181,7 +181,7 @@ int pemDecode(
        endPem = curr1;
        /* endPem points to last PEM data plus one */
        
-       out = cuDec64((unsigned char *)startPem, endPem-startPem, &outLen);
+       out = cuDec64((unsigned char *)startPem, (unsigned int)(endPem-startPem), &outLen);
        if(out == NULL) {
                printf("Bad PEM format (3)\n");
                ourRtn = -1;