1 From 7823e836e8279c8d77786d8f10ffaa83cf50bf1d Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
3 <ng.hong.quan@gmail.com>
4 Date: Wed, 10 Apr 2013 18:35:58 +0700
5 Subject: [PATCH 13/26] pkcs15-openpgp: Change to sc_put_data instead of
6 sc_update_binary when writing certificate.
9 src/pkcs15init/pkcs15-openpgp.c | 5 ++---
10 1 file changed, 2 insertions(+), 3 deletions(-)
12 diff --git a/src/pkcs15init/pkcs15-openpgp.c b/src/pkcs15init/pkcs15-openpgp.c
13 index 1455580..be1291e 100755
14 --- a/src/pkcs15init/pkcs15-openpgp.c
15 +++ b/src/pkcs15init/pkcs15-openpgp.c
16 @@ -279,10 +279,9 @@ static int openpgp_store_data(struct sc_pkcs15_card *p15card, struct sc_profile
17 r = sc_select_file(card, path, &file);
18 LOG_TEST_RET(card->ctx, r, "Cannot select cert file");
19 r = sc_pkcs15init_authenticate(profile, p15card, file, SC_AC_OP_UPDATE);
20 + sc_log(card->ctx, "Data to write is %d long", content->len);
21 if (r >= 0 && content->len)
22 - r = sc_update_binary(p15card->card, 0,
23 - (const unsigned char *) content->value,
25 + r = sc_put_data(p15card->card, 0x7F21, (const unsigned char *) content->value, content->len);
28 case SC_PKCS15_TYPE_DATA_OBJECT: