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

timestampskew issue #6

Closed
TeigeJDavidson opened this issue May 3, 2013 · 0 comments
Closed

timestampskew issue #6

TeigeJDavidson opened this issue May 3, 2013 · 0 comments

Comments

@TeigeJDavidson
Copy link

Please check the Timestamp validation in the Checkstamp check

in the GetAuthorizationHeader why divide by 1000, since the value is supposed to be seconds?

    var normalizedTs = (ConvertToUnixTimestamp((ts.HasValue)
            ? ts.Value : DateTime.UtcNow)).ToString(); //removed / 1000

this causes issues in the CheckTimeStamp

    private static bool CheckTimestamp(string ts, int timestampSkewSec)
    {
        double parsedTs;
        if (double.TryParse(ts, out parsedTs))
        {
            var now = ConvertToUnixTimestamp(DateTime.Now);

            // Check timestamp staleness
            if (Math.Abs(parsedTs - now) > timestampSkewSec) //* 1000 
            {
                return false;
            }
            else
            {
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

No branches or pull requests

2 participants