e_chil.c (194206) | e_chil.c (206046) |
---|---|
1/* crypto/engine/e_chil.c -*- mode: C; c-file-style: "eay" -*- */ 2/* Written by Richard Levitte (richard@levitte.org), Geoff Thorpe 3 * (geoff@geoffthorpe.net) and Dr Stephen N Henson (steve@openssl.org) 4 * for the OpenSSL project 2000. 5 */ 6/* ==================================================================== 7 * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved. 8 * --- 1190 unchanged lines hidden (view full) --- 1199static int hwcrhk_get_pass(const char *prompt_info, 1200 int *len_io, char *buf, 1201 HWCryptoHook_PassphraseContext *ppctx, 1202 HWCryptoHook_CallerContext *cactx) 1203 { 1204 pem_password_cb *callback = NULL; 1205 void *callback_data = NULL; 1206 UI_METHOD *ui_method = NULL; | 1/* crypto/engine/e_chil.c -*- mode: C; c-file-style: "eay" -*- */ 2/* Written by Richard Levitte (richard@levitte.org), Geoff Thorpe 3 * (geoff@geoffthorpe.net) and Dr Stephen N Henson (steve@openssl.org) 4 * for the OpenSSL project 2000. 5 */ 6/* ==================================================================== 7 * Copyright (c) 1999-2001 The OpenSSL Project. All rights reserved. 8 * --- 1190 unchanged lines hidden (view full) --- 1199static int hwcrhk_get_pass(const char *prompt_info, 1200 int *len_io, char *buf, 1201 HWCryptoHook_PassphraseContext *ppctx, 1202 HWCryptoHook_CallerContext *cactx) 1203 { 1204 pem_password_cb *callback = NULL; 1205 void *callback_data = NULL; 1206 UI_METHOD *ui_method = NULL; |
1207 /* Despite what the documentation says prompt_info can be 1208 * an empty string. 1209 */ 1210 if (prompt_info && !*prompt_info) 1211 prompt_info = NULL; |
|
1207 1208 if (cactx) 1209 { 1210 if (cactx->ui_method) 1211 ui_method = cactx->ui_method; 1212 if (cactx->password_callback) 1213 callback = cactx->password_callback; 1214 if (cactx->callback_data) --- 85 unchanged lines hidden (view full) --- 1300 } 1301 1302 ui = UI_new_method(ui_method); 1303 1304 if (ui) 1305 { 1306 char answer; 1307 char buf[BUFSIZ]; | 1212 1213 if (cactx) 1214 { 1215 if (cactx->ui_method) 1216 ui_method = cactx->ui_method; 1217 if (cactx->password_callback) 1218 callback = cactx->password_callback; 1219 if (cactx->callback_data) --- 85 unchanged lines hidden (view full) --- 1305 } 1306 1307 ui = UI_new_method(ui_method); 1308 1309 if (ui) 1310 { 1311 char answer; 1312 char buf[BUFSIZ]; |
1308 1309 if (wrong_info) | 1313 /* Despite what the documentation says wrong_info can be 1314 * an empty string. 1315 */ 1316 if (wrong_info && *wrong_info) |
1310 BIO_snprintf(buf, sizeof(buf)-1, 1311 "Current card: \"%s\"\n", wrong_info); 1312 ok = UI_dup_info_string(ui, buf); 1313 if (ok >= 0 && prompt_info) 1314 { 1315 BIO_snprintf(buf, sizeof(buf)-1, 1316 "Insert card \"%s\"", prompt_info); 1317 ok = UI_dup_input_boolean(ui, buf, --- 51 unchanged lines hidden --- | 1317 BIO_snprintf(buf, sizeof(buf)-1, 1318 "Current card: \"%s\"\n", wrong_info); 1319 ok = UI_dup_info_string(ui, buf); 1320 if (ok >= 0 && prompt_info) 1321 { 1322 BIO_snprintf(buf, sizeof(buf)-1, 1323 "Insert card \"%s\"", prompt_info); 1324 ok = UI_dup_input_boolean(ui, buf, --- 51 unchanged lines hidden --- |