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.

36 lines
1.4 KiB

  1. From f4aec38233010953cea72c367bccc71c3687b2f1 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: Tue, 16 Apr 2013 16:02:17 +0700
  5. Subject: [PATCH 17/26] OpenPGP: Make code neater
  6. ---
  7. src/libopensc/card-openpgp.c | 8 ++------
  8. 1 file changed, 2 insertions(+), 6 deletions(-)
  9. Index: opensc-20150513/src/libopensc/card-openpgp.c
  10. ===================================================================
  11. --- opensc-20150513.orig/src/libopensc/card-openpgp.c
  12. +++ opensc-20150513/src/libopensc/card-openpgp.c
  13. @@ -1230,10 +1230,7 @@ static int gnuk_write_certificate(sc_car
  14. r = sc_transmit_apdu(card, &apdu);
  15. LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
  16. /* Check response */
  17. - r = sc_check_sw(card, apdu.sw1, apdu.sw2);
  18. - if (r < 0)
  19. - LOG_FUNC_RETURN(card->ctx, r);
  20. - LOG_FUNC_RETURN(card->ctx, length);
  21. + LOG_TEST_RET(card->ctx, sc_check_sw(card, apdu.sw1, apdu.sw2), "Certificate writing failed");
  22. }
  23. /* Ref: gnuk_put_binary_libusb.py and gnuk_token.py in Gnuk source tree */
  24. @@ -1270,8 +1267,7 @@ static int gnuk_write_certificate(sc_car
  25. r = sc_transmit_apdu(card, &apdu);
  26. LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
  27. /* Check response */
  28. - r = sc_check_sw(card, apdu.sw1, apdu.sw2);
  29. - LOG_TEST_RET(card->ctx, r, "UPDATE BINARY returned error");
  30. + LOG_TEST_RET(card->ctx, sc_check_sw(card, apdu.sw1, apdu.sw2), "UPDATE BINARY returned error");
  31. /* To next part */
  32. i++;