Skip to content
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

Expose signature creation time and expiration time as guint64 #69

Closed
wants to merge 1 commit into from

Conversation

dkg
Copy link
Contributor

@dkg dkg commented Dec 4, 2019

This is a very conservative change that attempts to address #68.

It avoids changing the memory layout of the GMimeSignature object,
since it might accessed directly by a user who doesn't use the
function interface.

It takes a different approach to indicating a failure than the
established (time_t)-1 mechanism, to encourage safer use.

Signed-off-by: Daniel Kahn Gillmor dkg@fifthhorseman.net

This is a very conservative change that attempts to address jstedfast#68.

It avoids changing the memory layout of the GMimeSignature object,
since it might accessed directly by a user who doesn't use the
function interface.

It takes a different approach to indicating a failure than the
established (time_t)-1 mechanism, to encourage safer use.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 64.548% when pulling 338ab71 on dkg:sigtime into c46ee83 on jstedfast:master.

g_return_val_if_fail (GMIME_IS_SIGNATURE (sig), FALSE);
g_return_val_if_fail (created != NULL, FALSE);
g_return_val_if_fail (sig->created != (time_t)-1, FALSE);

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g_return macros shouldn't be used for valid values and -1 is a valid value here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 is not a valid known value -- it's a value meaning "unknown", which this proposed alternate interface represents instead with a return code, instead of the output.

@dkg
Copy link
Contributor Author

dkg commented Dec 9, 2019

thanks for e797efe, which i think addresses the underlying issue, albeit in a different way than i've dealt with it here. For GMime 4.0, we can think about other ways to fix the problem, like #73.

@dkg dkg closed this Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants