Permalink
Browse files

debian/patches/*: refresh & extend patches

  • Loading branch information...
1 parent 8d053e2 commit d77002d81cdf0e0bf473e8015f12447e68a7b01b @marschap committed May 17, 2011
Showing with 1,878 additions and 713 deletions.
  1. +0 −490 debian/patches/0001-APDU-parsing-switch-to-Frank-Morgner-s-implementatio.patch
  2. +7 −17 debian/patches/0001-OpenPGP-fix-top-level-DOs-according-to-spec.patch
  3. +6 −5 debian/patches/0002-OpenPGP-add-indication-of-2048-RSA-agorithm-for-Open.patch
  4. +7 −16 debian/patches/0003-OpenPGP-try-to-match-flags-with-specification.patch
  5. +6 −6 debian/patches/0004-OpenPGP-re-factor-pgp_enumerate_blob.patch
  6. +12 −11 debian/patches/0005-OpenPGP-implement-function-to-free-the-fake-file-sys.patch
  7. +5 −5 debian/patches/0006-OpenPGP-NULL-ify-free-d-pointer.patch
  8. +5 −5 debian/patches/0007-OpenPGP-re-factor-pgp_set_blob.patch
  9. +5 −5 debian/patches/0008-OpenPGP-add-some-comments.patch
  10. +14 −14 debian/patches/0009-OpenPGP-use-symbolic-names-for-errors-success.patch
  11. +7 −7 debian/patches/0010-OpenPGP-catch-calloc-errors-in-pgp_new_blob.patch
  12. +8 −38 debian/patches/0011-OpenPGP-update-card-capabilities-from-historical-byt.patch
  13. +11 −24 debian/patches/0012-OpenPGP-use-card-extended-Lc-Le-capabilities.patch
  14. +18 −57 debian/patches/0013-OpenPGP-allow-extended-APDUs-in-all-functions.patch
  15. +6 −5 debian/patches/0014-OpenPGP-free-memory-when-selecting-the-application-f.patch
  16. +8 −7 debian/patches/0015-OpenPGP-implement-card_ctl-command-SC_CARDCTL_GET_SE.patch
  17. +70 −0 debian/patches/0016-OpenPGP-remove-unused-element-from-structure.patch
  18. +234 −0 debian/patches/0017-OpenPGP-briefly-document-each-function.patch
  19. +427 −0 debian/patches/0018-OpenPGP-sprinkle-with-LOG_.-macros.patch
  20. +46 −0 debian/patches/0019-OpenPGP-re-factor-pgp_finish.patch
  21. +45 −0 debian/patches/0020-OpenPGP-clean-up-with-pgp_finish.patch
  22. +63 −0 debian/patches/0021-OpenPGP-comment-use-of-current.patch
  23. +70 −0 debian/patches/0022-OpenPGP-re-factor-pgp_select_file.patch
  24. +63 −0 debian/patches/0023-OpenPGP-read-BCD-version-from-card.patch
  25. +249 −0 debian/patches/0024-OpenPGP-deal-with-DOs-depending-on-card-version.patch
  26. +57 −0 debian/patches/0025-OpenPGP-check-for-get_fn-NULL-in-pgp_read_blob.patch
  27. +88 −0 debian/patches/0026-OpenPGP-new-function-to-get-card-s-features.patch
  28. +53 −0 debian/patches/0027-OpenPGP-extend-pgp_get_card_features.patch
  29. +77 −0 debian/patches/0028-OpenPGP-get-flags-algorithms-in-pgp_get_card_feature.patch
  30. +39 −0 debian/patches/0029-OpenPGP-re-factor-pgp_get_blob.patch
  31. +31 −0 debian/patches/0030-OpenPGP-re-factor-pgp_list_files.patch
  32. +93 −0 debian/patches/0031-rewrite-bebyte-conversion-functions-NULL-check-retur.patch
  33. +31 −0 debian/patches/0032-OpenPGP-use-updated-ushort2bebytes-in-pgp_get_pubkey.patch
  34. +17 −1 debian/patches/series

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,7 +1,7 @@
-From 9861a860ccda105aea426f162e9ed37e1f0eae2d Mon Sep 17 00:00:00 2001
+From eb3257122183ac891f377d6b73343ae9ed5deab8 Mon Sep 17 00:00:00 2001
From: Peter Marschall <peter@adpm.de>
Date: Sun, 13 Mar 2011 21:41:12 +0100
-Subject: [PATCH 01/15] OpenPGP: fix top-level DOs according to spec
+Subject: [PATCH 01/32] OpenPGP: fix top-level DOs according to spec
Added:
* 00c4: new top-level DO in 2.0
@@ -14,14 +14,6 @@ Added:
for private use
max 254 bytes;
access: read - always; write - verify CHV3
-* 0103: new optional top-level DO starting in 1.1
- for private use
- max 254 bytes;
- access: read - verify CHV2; write - verify CHV2
-* 0104: new optional top-level DO starting in 1.1
- for private use
- max 254 bytes;
- access: read - verify CHV3; write - verify CHV3
* 5f52: new top-level DO in 2.0
can also be found inside constructed DOs 006E in 2.0
* 7f21: new optional top-level DO in 2.0
@@ -36,14 +28,14 @@ Trying to read non-existent top-level DOs or top-level DOs that weren't defined
in a spec version later than the current card's version does not hurt.
They are returned as empty.
---
- src/libopensc/card-openpgp.c | 10 ++++++++--
- 1 files changed, 8 insertions(+), 2 deletions(-)
+ src/libopensc/card-openpgp.c | 8 ++++++--
+ 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 386e687..0bb7f07 100644
+index 386e687..02a9561 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -91,12 +91,18 @@ static int pgp_get_pubkey_pem(sc_card_t *, unsigned int,
+@@ -91,12 +91,16 @@ static int pgp_get_pubkey_pem(sc_card_t *, unsigned int,
static struct do_info pgp_objects[] = {
{ 0x004f, 0, 0, sc_get_data, sc_put_data },
@@ -56,14 +48,12 @@ index 386e687..0bb7f07 100644
+ { 0x00c4, 0, 0, sc_get_data, sc_put_data },
+ { 0x0101, 0, 0, sc_get_data, sc_put_data },
+ { 0x0102, 0, 0, sc_get_data, sc_put_data },
-+// { 0x0103, 0, 0, sc_get_data, sc_put_data }, // needs verify with PW1
-+// { 0x0104, 0, 0, sc_get_data, sc_put_data }, // needs verify with PW3
{ 0x5f50, 0, 0, sc_get_data, sc_put_data },
+ { 0x5f52, 0, 0, sc_get_data, sc_put_data },
+ { 0x7f21, 1, 0, sc_get_data, sc_put_data },
{ 0xb600, 1, 0, pgp_get_pubkey, NULL },
{ 0xb800, 1, 0, pgp_get_pubkey, NULL },
{ 0xa400, 1, 0, pgp_get_pubkey, NULL },
--
-1.7.4.1
+1.7.4.4
@@ -1,17 +1,18 @@
-From ae71acb63daeca58391dde415d6228a78a6c53b1 Mon Sep 17 00:00:00 2001
+From 4064520bc76635290d75082d8a377d9315fb6613 Mon Sep 17 00:00:00 2001
From: Peter Marschall <peter@adpm.de>
Date: Sun, 13 Mar 2011 18:51:33 +0100
-Subject: [PATCH 02/15] OpenPGP: add indication of 2048 RSA agorithm for OpenPGP 2.0 cards
+Subject: [PATCH 02/32] OpenPGP: add indication of 2048 RSA agorithm for
+ OpenPGP 2.0 cards
---
src/libopensc/card-openpgp.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 0bb7f07..f123914 100644
+index 02a9561..11e51c4 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -160,6 +160,8 @@ pgp_init(sc_card_t *card)
+@@ -158,6 +158,8 @@ pgp_init(sc_card_t *card)
_sc_card_add_rsa_alg(card, 512, flags, 0);
_sc_card_add_rsa_alg(card, 768, flags, 0);
_sc_card_add_rsa_alg(card, 1024, flags, 0);
@@ -21,5 +22,5 @@ index 0bb7f07..f123914 100644
sc_format_path("D276:0001:2401", &aid);
aid.type = SC_PATH_TYPE_DF_NAME;
--
-1.7.4.1
+1.7.4.4
@@ -1,35 +1,26 @@
-From 5b30dacb9bbbcd0efc1850c91f450a70f475475e Mon Sep 17 00:00:00 2001
+From 8a0cb4550b222a17959b1338dbcd172565632aaa Mon Sep 17 00:00:00 2001
From: Peter Marschall <peter@adpm.de>
Date: Sun, 13 Mar 2011 19:04:29 +0100
-Subject: [PATCH 03/15] OpenPGP: try to match flags with specification
+Subject: [PATCH 03/32] OpenPGP: try to match flags with specification
---
- src/libopensc/card-openpgp.c | 10 ++++++++++
- 1 files changed, 10 insertions(+), 0 deletions(-)
+ src/libopensc/card-openpgp.c | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index f123914..8b893d5 100644
+index 11e51c4..b3f3d62 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -152,8 +152,18 @@ pgp_init(sc_card_t *card)
+@@ -150,7 +150,9 @@ pgp_init(sc_card_t *card)
card->cla = 0x00;
/* Is this correct? */
+ /* OpenPGP card spec 1.1 & 2.0, section 2.1 */
flags = SC_ALGORITHM_RSA_RAW;
+ /* OpenPGP card spec 1.1 & 2.0, section 7.2.9 & 7.2.10 */
flags |= SC_ALGORITHM_RSA_PAD_PKCS1;
-+ /* OpenPGP card 2.0 spec, section 7.2.8.1 */
-+ flags |= SC_ALGORITHM_RSA_HASH_SHA1 |
-+ SC_ALGORITHM_RSA_HASH_RIPEMD160;
-+ if (card->type == SC_CARD_TYPE_OPENPGP_V2)
-+ flags |= SC_ALGORITHM_RSA_HASH_SHA224 |
-+ SC_ALGORITHM_RSA_HASH_SHA256 |
-+ SC_ALGORITHM_RSA_HASH_SHA384 |
-+ SC_ALGORITHM_RSA_HASH_SHA512;
flags |= SC_ALGORITHM_RSA_HASH_NONE;
- /* Is this correct? */
--
-1.7.4.1
+1.7.4.4
@@ -1,7 +1,7 @@
-From 68488ef7f5f033d9d2bc33bc834fcac75e8f39cd Mon Sep 17 00:00:00 2001
+From e4e9eb85646d3ad79fadecef94c1121eff6b7700 Mon Sep 17 00:00:00 2001
From: Peter Marschall <peter@adpm.de>
Date: Sat, 19 Mar 2011 21:28:49 +0100
-Subject: [PATCH 04/15] OpenPGP: re-factor pgp_enumerate_blob()
+Subject: [PATCH 04/32] OpenPGP: re-factor pgp_enumerate_blob()
Leverage the fact that OpenPGP cards use TLV encoding according to
ASN.1 BER-encoding rules and use sc_asn1_read_tag() as the workhorse
@@ -15,10 +15,10 @@ This is done manually after calling sc_asn1_read_tag().
1 files changed, 27 insertions(+), 39 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 8b893d5..e2b0229 100644
+index b3f3d62..2472161 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -276,12 +276,12 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
+@@ -266,12 +266,12 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
/*
* Enumerate contents of a data blob.
@@ -33,7 +33,7 @@ index 8b893d5..e2b0229 100644
int r;
if (blob->files != NULL)
-@@ -291,52 +291,40 @@ pgp_enumerate_blob(sc_card_t *card, struct blob *blob)
+@@ -281,52 +281,40 @@ pgp_enumerate_blob(sc_card_t *card, struct blob *blob)
return r;
in = blob->data;
@@ -112,5 +112,5 @@ index 8b893d5..e2b0229 100644
static int
--
-1.7.4.1
+1.7.4.4
@@ -1,7 +1,8 @@
-From 5796bfa97ac2066b41424b64dfff6861198b8d50 Mon Sep 17 00:00:00 2001
+From a3c65345d5baaae55e9b168bda78cc68130a3e4b Mon Sep 17 00:00:00 2001
From: Peter Marschall <peter@adpm.de>
Date: Sat, 19 Mar 2011 20:06:42 +0100
-Subject: [PATCH 05/15] OpenPGP: implement function to free the fake file system
+Subject: [PATCH 05/32] OpenPGP: implement function to free the fake file
+ system
* pgp_iterate_blobs(): walk through the blob tree
* pgp_free_blob(): free a blob
@@ -10,7 +11,7 @@ Subject: [PATCH 05/15] OpenPGP: implement function to free the fake file system
1 files changed, 49 insertions(+), 8 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index e2b0229..111b948 100644
+index 2472161..e0abe68 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
@@ -82,8 +82,11 @@ struct do_info {
@@ -25,7 +26,7 @@ index e2b0229..111b948 100644
static int pgp_get_pubkey(sc_card_t *, unsigned int,
u8 *, size_t);
static int pgp_get_pubkey_pem(sc_card_t *, unsigned int,
-@@ -115,7 +118,7 @@ static struct do_info pgp_objects[] = {
+@@ -113,7 +116,7 @@ static struct do_info pgp_objects[] = {
#define DRVDATA(card) ((struct pgp_priv_data *) ((card)->drv_data))
struct pgp_priv_data {
@@ -34,7 +35,7 @@ index e2b0229..111b948 100644
struct blob * current;
sc_security_env_t sec_env;
-@@ -148,6 +151,12 @@ pgp_init(sc_card_t *card)
+@@ -146,6 +149,12 @@ pgp_init(sc_card_t *card)
priv = calloc (1, sizeof *priv);
if (!priv)
return SC_ERROR_OUT_OF_MEMORY;
@@ -47,7 +48,7 @@ index e2b0229..111b948 100644
card->drv_data = priv;
card->cla = 0x00;
-@@ -183,15 +192,15 @@ pgp_init(sc_card_t *card)
+@@ -173,15 +182,15 @@ pgp_init(sc_card_t *card)
file->type = SC_FILE_TYPE_DF;
file->id = 0x3f00;
@@ -67,7 +68,7 @@ index e2b0229..111b948 100644
info->constructed? SC_FILE_TYPE_DF
: SC_FILE_TYPE_WORKING_EF,
info);
-@@ -208,7 +217,8 @@ pgp_finish(sc_card_t *card)
+@@ -198,7 +207,8 @@ pgp_finish(sc_card_t *card)
return 0;
priv = DRVDATA (card);
@@ -77,7 +78,7 @@ index e2b0229..111b948 100644
free(priv);
return 0;
-@@ -253,6 +263,37 @@ pgp_new_blob(struct blob *parent, unsigned int file_id,
+@@ -243,6 +253,37 @@ pgp_new_blob(struct blob *parent, unsigned int file_id,
return blob;
}
@@ -115,7 +116,7 @@ index e2b0229..111b948 100644
static int
pgp_read_blob(sc_card_t *card, struct blob *blob)
{
-@@ -374,7 +415,7 @@ pgp_select_file(sc_card_t *card, const sc_path_t *path, sc_file_t **ret)
+@@ -364,7 +405,7 @@ pgp_select_file(sc_card_t *card, const sc_path_t *path, sc_file_t **ret)
path = &path_copy;
}
@@ -124,7 +125,7 @@ index e2b0229..111b948 100644
for (n = 0; n < path->len; n += 2) {
r = pgp_get_blob(card, blob,
(path->value[n] << 8) | path->value[n+1],
-@@ -491,7 +532,7 @@ pgp_get_pubkey_pem(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
+@@ -481,7 +522,7 @@ pgp_get_pubkey_pem(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "called, tag=%04x\n", tag);
@@ -134,5 +135,5 @@ index e2b0229..111b948 100644
|| (r = pgp_get_blob(card, blob, 0x0081, &mod_blob)) < 0
|| (r = pgp_get_blob(card, blob, 0x0082, &exp_blob)) < 0
--
-1.7.4.1
+1.7.4.4
@@ -1,17 +1,17 @@
-From 23620d14f674f0883d0f7c1efebfb733dd47d57c Mon Sep 17 00:00:00 2001
+From 8299385db4f13d6826e64cd6b380785963f26a47 Mon Sep 17 00:00:00 2001
From: Peter Marschall <peter@adpm.de>
Date: Sun, 13 Mar 2011 19:08:16 +0100
-Subject: [PATCH 06/15] OpenPGP: NULL-ify free()'d pointer
+Subject: [PATCH 06/32] OpenPGP: NULL-ify free()'d pointer
---
src/libopensc/card-openpgp.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 111b948..b7379f2 100644
+index e0abe68..6b4e604 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -221,6 +221,7 @@ pgp_finish(sc_card_t *card)
+@@ -211,6 +211,7 @@ pgp_finish(sc_card_t *card)
pgp_iterate_blobs(priv->mf, 99, pgp_free_blob);
free(priv);
@@ -20,5 +20,5 @@ index 111b948..b7379f2 100644
}
--
-1.7.4.1
+1.7.4.4
@@ -1,7 +1,7 @@
-From cb4b396a3a933ae0d0b643d548c44a7116e42834 Mon Sep 17 00:00:00 2001
+From b22cf381a7771fefda60deae8e129e4a510bddb1 Mon Sep 17 00:00:00 2001
From: Peter Marschall <peter@adpm.de>
Date: Sun, 13 Mar 2011 19:26:35 +0100
-Subject: [PATCH 07/15] OpenPGP: re-factor pgp_set_blob()
+Subject: [PATCH 07/32] OpenPGP: re-factor pgp_set_blob()
* NULL-ify freed data pointer
* avoid unnecessary malloc() calls
@@ -12,10 +12,10 @@ Subject: [PATCH 07/15] OpenPGP: re-factor pgp_set_blob()
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index b7379f2..c0c0e55 100644
+index 6b4e604..879f5fe 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -230,12 +230,24 @@ pgp_set_blob(struct blob *blob, const u8 *data, size_t len)
+@@ -220,12 +220,24 @@ pgp_set_blob(struct blob *blob, const u8 *data, size_t len)
{
if (blob->data)
free(blob->data);
@@ -45,5 +45,5 @@ index b7379f2..c0c0e55 100644
}
--
-1.7.4.1
+1.7.4.4
@@ -1,14 +1,14 @@
-From b81b0fea544c83cb7d0bd094e9ab1851f304e1cb Mon Sep 17 00:00:00 2001
+From 0de803b61fae19846a06b9d7f374f677899adeb0 Mon Sep 17 00:00:00 2001
From: Peter Marschall <peter@adpm.de>
Date: Sun, 13 Mar 2011 19:32:05 +0100
-Subject: [PATCH 08/15] OpenPGP: add some comments
+Subject: [PATCH 08/32] OpenPGP: add some comments
---
src/libopensc/card-openpgp.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index c0c0e55..54dd607 100644
+index 879f5fe..8effaf7 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
@@ -61,8 +61,8 @@ static struct sc_card_driver pgp_drv = {
@@ -31,7 +31,7 @@ index c0c0e55..54dd607 100644
};
struct do_info {
-@@ -182,9 +182,9 @@ pgp_init(sc_card_t *card)
+@@ -172,9 +172,9 @@ pgp_init(sc_card_t *card)
if (card->type == SC_CARD_TYPE_OPENPGP_V2)
_sc_card_add_rsa_alg(card, 2048, flags, 0);
@@ -43,5 +43,5 @@ index c0c0e55..54dd607 100644
return r;
--
-1.7.4.1
+1.7.4.4
Oops, something went wrong.

0 comments on commit d77002d

Please sign in to comment.