openpgp-tool: increase buffer for private DOs

* OpenPGP v3 increased the size for private DOs. Adapt to it.
* Use the symbolic constant from the refactored OpenPGP driver
  instead of relying on magic numbers.
This commit is contained in:
Peter Marschall 2020-01-26 09:44:43 +01:00
parent cd4dc5a9e7
commit 7d3e4b0878
1 changed files with 2 additions and 1 deletions

View File

@ -47,6 +47,7 @@
#include "libopensc/errors.h"
#include "util.h"
#include "libopensc/log.h"
#include "libopensc/card-openpgp.h"
#define OPT_RAW 256
#define OPT_PRETTY 257
@ -613,7 +614,7 @@ static int do_dump_do(sc_card_t *card, unsigned int tag)
{
int r;
size_t length;
unsigned char buffer[254]; // Private DO are specified up to 254 bytes
unsigned char buffer[MAX_OPENPGP_DO_SIZE];
memset(buffer, '\0', sizeof(buffer));