From: Nikos Mavrogiannopoulos Date: Thu, 21 May 2015 08:46:26 +0000 (+0200) Subject: removed useless check X-Git-Tag: gnutls_3_4_2~80 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e76aff69a545b43c53af58a23af07f707c63f4e7;p=thirdparty%2Fgnutls.git removed useless check --- diff --git a/lib/pkcs11.c b/lib/pkcs11.c index 11ef05574b..730d094b0c 100644 --- a/lib/pkcs11.c +++ b/lib/pkcs11.c @@ -2363,25 +2363,23 @@ retrieve_pin(struct pin_info_st *pin_info, struct p11_kit_uri *info, const char *pinfile; int ret = GNUTLS_E_PKCS11_PIN_ERROR; - if (pin) { - *pin = NULL; - - /* First check for pin-value field */ - pinfile = p11_kit_uri_get_pin_value(info); + *pin = NULL; + + /* First check for pin-value field */ + pinfile = p11_kit_uri_get_pin_value(info); + if (pinfile != NULL) { + _gnutls_debug_log("p11: Using pin-value to retrieve PIN\n"); + *pin = p11_kit_pin_new_for_string(pinfile); + if (*pin != NULL) + ret = 0; + } else { /* try pin-source */ + /* Check if a pinfile is specified, and use that if possible */ + pinfile = p11_kit_uri_get_pin_source(info); if (pinfile != NULL) { - _gnutls_debug_log("p11: Using pin-value to retrieve PIN\n"); - *pin = p11_kit_pin_new_for_string(pinfile); - if (*pin != NULL) - ret = 0; - } else { /* try pin-source */ - /* Check if a pinfile is specified, and use that if possible */ - pinfile = p11_kit_uri_get_pin_source(info); - if (pinfile != NULL) { - _gnutls_debug_log("p11: Using pin-source to retrieve PIN\n"); - ret = - retrieve_pin_from_source(pinfile, token_info, attempts, - user_type, pin); - } + _gnutls_debug_log("p11: Using pin-source to retrieve PIN\n"); + ret = + retrieve_pin_from_source(pinfile, token_info, attempts, + user_type, pin); } }