For indefinite length objects, we check for the terminator here:
However, this does not consider that a SEQUENCE or SET can be potentially empty with indefinite length.
Instead, I think the proper thing is to first check for the termination sequence and only then read the object.
I.e., move the if condition above this line:
For indefinite length objects, we check for the terminator here:
smimesign/ietf-cms/protocol/ber.go
Line 217 in 3564e86
However, this does not consider that a SEQUENCE or SET can be potentially empty with indefinite length.
Instead, I think the proper thing is to first check for the termination sequence and only then read the object.
I.e., move the if condition above this line:
smimesign/ietf-cms/protocol/ber.go
Line 209 in 3564e86