Skip to content

Tested and adjusted the c2i into d2i using the correct pointer handling #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Folloed directions for resetting the pointer (#2)
  • Loading branch information
olivierbrand authored Jan 31, 2023
commit 3844d8c03f12d150707a1ba0cf158826f1e49e91
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ fileprivate struct ReceiptParser {
var xclass = Int32(0)
var intLength = 0

let ptrBackup = intPointer
ASN1_get_object(&intPointer, &intLength, &type, &xclass, length)

guard type == V_ASN1_INTEGER else {
Expand All @@ -441,6 +442,8 @@ fileprivate struct ReceiptParser {
// ASN1_INTEGER_free(integer)
// return result

intPointer = ptrBackup

let integer = d2i_ASN1_UINTEGER(nil, &intPointer, length)
let result = ASN1_INTEGER_get(integer)
ASN1_INTEGER_free(integer)
Expand Down