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.

28 lines
1.2 KiB

  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.
  7. ---
  8. src/pkcs15init/pkcs15-openpgp.c | 5 ++---
  9. 1 file changed, 2 insertions(+), 3 deletions(-)
  10. Index: opensc-20150513/src/pkcs15init/pkcs15-openpgp.c
  11. ===================================================================
  12. --- opensc-20150513.orig/src/pkcs15init/pkcs15-openpgp.c
  13. +++ opensc-20150513/src/pkcs15init/pkcs15-openpgp.c
  14. @@ -279,10 +279,9 @@ static int openpgp_store_data(struct sc_
  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: