summaryrefslogtreecommitdiff
path: root/p11-kit
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-06-21 19:31:15 +0200
committerStef Walter <stefw@collabora.co.uk>2011-07-06 12:49:26 +0200
commit2cc2ab90a6b96ea75dfe4d6413e41539075e8f8a (patch)
treea1db8f143238562bdbc17dca4fc8bce165470ff3 /p11-kit
parentf1ca5d5b57909534d8b21f9be455c94ca57e6636 (diff)
Rename p11_kit_pin_read_pinfile to p11_kit_pin_retrieve
* Fix up duplicate register logic as well.
Diffstat (limited to 'p11-kit')
-rw-r--r--p11-kit/pin.c13
-rw-r--r--p11-kit/pin.h4
2 files changed, 9 insertions, 8 deletions
diff --git a/p11-kit/pin.c b/p11-kit/pin.c
index 328785f..14cb171 100644
--- a/p11-kit/pin.c
+++ b/p11-kit/pin.c
@@ -284,9 +284,9 @@ p11_kit_pin_unregister_callback (const char *pinfile, p11_kit_pin_callback callb
}
int
-p11_kit_pin_read_pinfile (const char *pinfile, P11KitUri *pin_uri,
- const char *pin_description, P11KitPinFlags flags,
- char *pin, size_t pin_max)
+p11_kit_pin_retrieve (const char *pinfile, P11KitUri *pin_uri,
+ const char *pin_description, P11KitPinFlags flags,
+ char *pin, size_t pin_length)
{
PinfileCallback **snapshot = NULL;
unsigned int snapshot_count = 0;
@@ -317,9 +317,10 @@ p11_kit_pin_read_pinfile (const char *pinfile, P11KitUri *pin_uri,
if (snapshot == NULL)
return 0;
- for (i = 0; i < snapshot_count; i++) {
- ret = (snapshot[i]->func) (pinfile, pin_uri, pin_description, flags,
- snapshot[i]->user_data, pin, pin_max);
+ ret = 0;
+ for (i = snapshot_count; ret == 0 && i > 0; i--) {
+ ret = (snapshot[i - 1]->func) (pinfile, pin_uri, pin_description, flags,
+ snapshot[i - 1]->user_data, pin, pin_length);
}
_p11_lock ();
diff --git a/p11-kit/pin.h b/p11-kit/pin.h
index 780e72d..bb5daae 100644
--- a/p11-kit/pin.h
+++ b/p11-kit/pin.h
@@ -58,7 +58,7 @@ typedef int (*p11_kit_pin_callback) (const char *pinfile
P11KitPinFlags pin_flags,
void *callback_data,
char *pin,
- size_t pin_max);
+ size_t pin_length);
typedef void (*p11_kit_pin_callback_destroy) (void *callback_data);
@@ -71,7 +71,7 @@ void p11_kit_pin_unregister_callback (const char *pinfile
p11_kit_pin_callback callback,
void *callback_data);
-int p11_kit_pin_read_pinfile (const char *pinfile,
+int p11_kit_pin_retrieve (const char *pinfile,
P11KitUri *pin_uri,
const char *pin_description,
P11KitPinFlags pin_flags,