*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
/* Old style PEM password callback */
static int test_pem_password_cb(char *buf, int size, int rwflag, void *userdata)
{
OPENSSL_strlcpy(buf, (char *)userdata, (size_t)size);
/* Old style PEM password callback */
static int test_pem_password_cb(char *buf, int size, int rwflag, void *userdata)
{
OPENSSL_strlcpy(buf, (char *)userdata, (size_t)size);
}
/*
* Test wrapping old style PEM password callback in a UI method through the
* use of UI utility functions
*/
}
/*
* Test wrapping old style PEM password callback in a UI method through the
* use of UI utility functions
*/
- if ((ui_method =
- UI_UTIL_wrap_read_pem_callback(test_pem_password_cb, 0)) == NULL
- || (ui = UI_new_method(ui_method)) == NULL)
+ if (!TEST_ptr(ui_method =
+ UI_UTIL_wrap_read_pem_callback( test_pem_password_cb, 0))
+ || !TEST_ptr(ui = UI_new_method(ui_method)))
- if (password_callback(pass, sizeof(pass), 0, &cb_data) > 0
- && strcmp(pass, cb_data.password) == 0)
+ if (TEST_int_gt(password_callback(pass, sizeof(pass), 0, &cb_data), 0)
+ && TEST_str_eq(pass, cb_data.password))