You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.2 KiB

  1. From e5c94d3f1f7e6a96a98815d6e51190498c357fb6 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/18] pkcs15-openpgp: Change to sc_put_data instead of
  6. sc_update_binary when writing certificate.
  7. ---
  8. src/pkcs15init/pkcs15-openpgp.c | 5 ++---
  9. 1 file changed, 2 insertions(+), 3 deletions(-)
  10. diff --git a/src/pkcs15init/pkcs15-openpgp.c b/src/pkcs15init/pkcs15-openpgp.c
  11. index 1455580..be1291e 100755
  12. --- a/src/pkcs15init/pkcs15-openpgp.c
  13. +++ b/src/pkcs15init/pkcs15-openpgp.c
  14. @@ -279,10 +279,9 @@ static int openpgp_store_data(struct sc_pkcs15_card *p15card, struct sc_profile
  15. r = sc_select_file(card, path, &file);
  16. LOG_TEST_RET(card->ctx, r, "Cannot select cert file");
  17. r = sc_pkcs15init_authenticate(profile, p15card, file, SC_AC_OP_UPDATE);
  18. + sc_log(card->ctx, "Data to write is %d long", content->len);
  19. if (r >= 0 && content->len)
  20. - r = sc_update_binary(p15card->card, 0,
  21. - (const unsigned char *) content->value,
  22. - content->len, 0);
  23. + r = sc_put_data(p15card->card, 0x7F21, (const unsigned char *) content->value, content->len);
  24. break;
  25. case SC_PKCS15_TYPE_DATA_OBJECT:
  26. --
  27. 1.9.3