Skip to content

Commit

Permalink
pgp: fixed internal data handling when overwriting key/cert
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmorgner committed Apr 17, 2024
1 parent fe2c1c8 commit 6b1e146
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libopensc/card-openpgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2558,8 +2558,8 @@ pgp_update_new_algo_attr(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_
}

pgp_set_blob(algo_blob, data, data_len);
r = pgp_put_data(card, tag, data, data_len);
free(data);
r = pgp_put_data(card, tag, algo_blob->data, data_len);
/* Note: Don't use pgp_set_blob to set data, because it won't touch the real DO */
LOG_TEST_RET(card->ctx, r, "Cannot set new algorithm attributes");
} else {
Expand Down

0 comments on commit 6b1e146

Please sign in to comment.