Update pkeyutl to use size_t for pkey functions.
[openssl.git] / apps / pkeyutl.c
index 4b19a3fb303acb712a5e30b79ce434c4a3a37856..a3ac23c2d8885879f26ca7e3f5c0baaa58c341bd 100644 (file)
@@ -80,8 +80,8 @@ static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform,
                                                        const char *file);
 
 static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
                                                        const char *file);
 
 static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
-               unsigned char *out, int *poutlen,
-               unsigned char *in, int inlen);
+               unsigned char *out, size_t *poutlen,
+               unsigned char *in, size_t inlen);
 
 int MAIN(int argc, char **);
 
 
 int MAIN(int argc, char **);
 
@@ -337,7 +337,7 @@ int MAIN(int argc, char **argv)
                }
        else
                {       
                }
        else
                {       
-               rv = do_keyop(ctx, pkey_op, NULL, &buf_outlen,
+               rv = do_keyop(ctx, pkey_op, NULL, (size_t *)&buf_outlen,
                                                        buf_in, buf_inlen);
                if (rv > 0)
                        {
                                                        buf_in, buf_inlen);
                if (rv > 0)
                        {
@@ -346,7 +346,7 @@ int MAIN(int argc, char **argv)
                                rv = -1;
                        else
                                rv = do_keyop(ctx, pkey_op,
                                rv = -1;
                        else
                                rv = do_keyop(ctx, pkey_op,
-                                               buf_out, &buf_outlen,
+                                               buf_out, (size_t *)&buf_outlen,
                                                buf_in, buf_inlen);
                        }
                }
                                                buf_in, buf_inlen);
                        }
                }
@@ -536,30 +536,30 @@ static int setup_peer(BIO *err, EVP_PKEY_CTX *ctx, int peerform,
        }
 
 static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
        }
 
 static int do_keyop(EVP_PKEY_CTX *ctx, int pkey_op,
-               unsigned char *out, int *poutlen,
-               unsigned char *in, int inlen)
+               unsigned char *out, size_t *poutlen,
+               unsigned char *in, size_t inlen)
        {
        int rv;
        switch(pkey_op)
                {
                case EVP_PKEY_OP_VERIFYRECOVER:
        {
        int rv;
        switch(pkey_op)
                {
                case EVP_PKEY_OP_VERIFYRECOVER:
-               rv  = EVP_PKEY_verify_recover(ctx, out, (unsigned int *)poutlen, in, inlen);
+               rv  = EVP_PKEY_verify_recover(ctx, out, poutlen, in, inlen);
                break;
 
                case EVP_PKEY_OP_SIGN:
                break;
 
                case EVP_PKEY_OP_SIGN:
-               rv  = EVP_PKEY_sign(ctx, out, (unsigned int *)poutlen, in, inlen);
+               rv  = EVP_PKEY_sign(ctx, out, poutlen, in, inlen);
                break;
 
                case EVP_PKEY_OP_ENCRYPT:
                break;
 
                case EVP_PKEY_OP_ENCRYPT:
-               rv  = EVP_PKEY_encrypt(ctx, out, (unsigned int *)poutlen, in, inlen);
+               rv  = EVP_PKEY_encrypt(ctx, out, poutlen, in, inlen);
                break;
 
                case EVP_PKEY_OP_DECRYPT:
                break;
 
                case EVP_PKEY_OP_DECRYPT:
-               rv  = EVP_PKEY_decrypt(ctx, out, (unsigned int *)poutlen, in, inlen);
+               rv  = EVP_PKEY_decrypt(ctx, out, poutlen, in, inlen);
                break; 
 
                case EVP_PKEY_OP_DERIVE:
                break; 
 
                case EVP_PKEY_OP_DERIVE:
-               rv  = EVP_PKEY_derive(ctx, out, (unsigned int *)poutlen);
+               rv  = EVP_PKEY_derive(ctx, out, poutlen);
                break;
 
                }
                break;
 
                }