{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1750485213,
"reponame":"openssl",
"desc":"OpenSSL",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"fa55bc5497cf5d5db7efbb1cb559e06d",
"commit": {"type":"commit",
"time": 1481189164,
"time_ofs": 60,
"oid_tree": { "oid": "53a811adf1c89e669c251562e83a8a0eaf236e0e", "alias": []},
"oid":{ "oid": "57c0f378b8fdbdc55dba783e9b744b8ed2132819", "alias": []},
"msg": "Make sure that password_callback exercises UI",
"sig_commit": { "git_time": { "time": 1481189164, "offset": 60 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" },
"sig_author": { "git_time": { "time": 1481156851, "offset": 60 }, "name": "Richard Levitte", "email": "levitte@openssl.org", "md5": "b737120f0642a6a5c30c6291e6170c77" }},
"body": "Make sure that password_callback exercises UI\n\nReviewed-by: Rich Salz \u003crsalz@openssl.org\u003e\n(Merged from https://github.com/openssl/openssl/pull/2040)"
,
"diff": "diff --git a/apps/apps.c b/apps/apps.c\nindex dd6fb08..d911c0f 100644\n--- a/apps/apps.c\n+++ b/apps/apps.c\n@@ -252,36 +252,27 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)\n int res \u003d 0;\n #ifndef OPENSSL_NO_UI\n UI *ui \u003d NULL;\n- const char *prompt_info \u003d NULL;\n #endif\n- const char *password \u003d NULL;\n PW_CB_DATA *cb_data \u003d (PW_CB_DATA *)cb_tmp;\n \n- if (cb_data) {\n- if (cb_data-\u003epassword)\n- password \u003d cb_data-\u003epassword;\n-#ifndef OPENSSL_NO_UI\n- if (cb_data-\u003eprompt_info)\n- prompt_info \u003d cb_data-\u003eprompt_info;\n-#endif\n- }\n-\n- if (password) {\n- res \u003d strlen(password);\n+#ifdef OPENSSL_NO_UI\n+ if (cb_data !\u003d NULL \u0026\u0026 cb_data-\u003epassword !\u003d NULL) {\n+ res \u003d strlen(cb_data-\u003epassword);\n if (res \u003e bufsiz)\n res \u003d bufsiz;\n- memcpy(buf, password, res);\n- return res;\n+ memcpy(buf, cb_data-\u003epassword, res);\n }\n-\n-#ifndef OPENSSL_NO_UI\n+#else\n ui \u003d UI_new_method(ui_method);\n if (ui) {\n int ok \u003d 0;\n char *buff \u003d NULL;\n int ui_flags \u003d 0;\n+ const char *prompt_info \u003d NULL;\n char *prompt;\n \n+ if (cb_data !\u003d NULL \u0026\u0026 cb_data-\u003eprompt_info !\u003d NULL)\n+ prompt_info \u003d cb_data-\u003eprompt_info;\n prompt \u003d UI_construct_prompt(ui, \u0022pass phrase\u0022, prompt_info);\n if (!prompt) {\n BIO_printf(bio_err, \u0022Out of memory\u005cn\u0022);\n@@ -292,6 +283,9 @@ int password_callback(char *buf, int bufsiz, int verify, PW_CB_DATA *cb_tmp)\n ui_flags |\u003d UI_INPUT_FLAG_DEFAULT_PWD;\n UI_ctrl(ui, UI_CTRL_PRINT_ERRORS, 1, 0, 0);\n \n+ /* We know that there is no previous user data to return to us */\n+ (void)UI_add_user_data(ui, cb_data);\n+\n if (ok \u003e\u003d 0)\n ok \u003d UI_add_input_string(ui, prompt, ui_flags, buf,\n PW_MIN_LENGTH, bufsiz - 1);\n","s":{"c":1750342525,"u": 15891}}
],"g": 772,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "7d0a"}