issue-8493: Fix for filenames with newlines using openssl dgst
[openssl.git] / test / p_test.c
index 6dc04103c44ec2b12ac95995e7f8ce8981e63f2d..9e1ba8edb3bf0100cb2aaded0bfb6ed17951dc68 100644 (file)
@@ -53,9 +53,9 @@ static int p_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[])
             static char *opensslv = NULL;
             static char *provname = NULL;
             static OSSL_PARAM counter_request[] = {
-                { "openssl-version", OSSL_PARAM_UTF8_STRING_PTR,
+                { "openssl-version", OSSL_PARAM_UTF8_PTR,
                   &opensslv, sizeof(&opensslv), NULL },
-                { "provider-name", OSSL_PARAM_UTF8_STRING_PTR,
+                { "provider-name", OSSL_PARAM_UTF8_PTR,
                   &provname, sizeof(&provname), NULL},
                 { NULL, 0, NULL, 0, NULL }
             };
@@ -63,8 +63,8 @@ static int p_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[])
             size_t buf_l;
 
             if (c_get_params(prov, counter_request)) {
-                const char *versionp = *(void **)counter_request[0].buffer;
-                const char *namep = *(void **)counter_request[1].buffer;
+                const char *versionp = *(void **)counter_request[0].data;
+                const char *namep = *(void **)counter_request[1].data;
                 sprintf(buf, "Hello OpenSSL %.20s, greetings from %s!",
                         versionp, namep);
             } else {
@@ -72,8 +72,8 @@ static int p_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[])
             }
 
             *p->return_size = buf_l = strlen(buf) + 1;
-            if (p->buffer_size >= buf_l)
-                strncpy(p->buffer, buf, buf_l);
+            if (p->data_size >= buf_l)
+                strncpy(p->data, buf, buf_l);
             else
                 ok = 0;
         }