Skip to content

Commit

Permalink
Follow up of dec061f
Browse files Browse the repository at this point in the history
Use EVP_PKEY_set1_RSA() instead of EVP_PKEY_assign_RSA, since
the public key will be freed when releasing pkey-
  • Loading branch information
9EOR9 committed Jun 16, 2021
1 parent 66732cc commit 85c3742
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 20 deletions.
19 changes: 0 additions & 19 deletions man/WARNING

This file was deleted.

2 changes: 1 addition & 1 deletion plugins/auth/caching_sha2_pw.c
Expand Up @@ -340,7 +340,7 @@ static int auth_caching_sha2_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
if ((pubkey= PEM_read_bio_RSA_PUBKEY(bio, NULL, NULL, NULL)))
{
EVP_PKEY *pkey= EVP_PKEY_new();
EVP_PKEY_assign_RSA(pkey, pubkey);
EVP_PKEY_set1_RSA(pkey, pubkey);
rsa_size= EVP_PKEY_size(pkey);
EVP_PKEY_free(pkey);
}
Expand Down
1 change: 1 addition & 0 deletions scripts/create_man
Expand Up @@ -39,6 +39,7 @@ funcs= func_list.split(";")
for function in funcs:

try:
print("%s/%s.md" % (args.docs, function))
content= read_content("%s/%s.md" % (args.docs, function))

except:
Expand Down
37 changes: 37 additions & 0 deletions unittest/libmariadb/misc.c
Expand Up @@ -1520,7 +1520,44 @@ static int test_conc533(MYSQL *mysql)
return OK;
}

int display_extended_field_attribute(MYSQL *mysql)
{
MYSQL_RES *result;
MYSQL_FIELD *fields;

if (mysql_query(mysql, "CREATE TEMPORARY TABLE t1 (a POINT)"))
return 1;

if (mysql_query(mysql, "SELECT a FROM t1"))
return 1;

if (!(result= mysql_store_result(mysql)))
return 1;

if ((fields= mysql_fetch_fields(result)))
{
MARIADB_CONST_STRING field_attr;

if (!mariadb_field_attr(&field_attr, &fields[0],
MARIADB_FIELD_ATTR_DATA_TYPE_NAME))
{
printf("Extended field attribute: %s\n", field_attr.str);
}
}
mysql_free_result(result);
return 0;
}


static int test_ext_field_attr(MYSQL *mysql)
{
display_extended_field_attribute(mysql);

return OK;
}

struct my_tests_st my_tests[] = {
{"test_ext_field_attr", test_ext_field_attr, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
{"test_conc533", test_conc533, TEST_CONNECTION_NEW, 0, NULL, NULL},
{"test_conc458", test_conc458, TEST_CONNECTION_NONE, 0, NULL, NULL},
{"test_conc457", test_conc457, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
Expand Down

0 comments on commit 85c3742

Please sign in to comment.