Skip to content

Commit

Permalink
xrCore/Crypto/xr_dsa_signer: Ported to stdlib.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaffeine committed Nov 15, 2015
1 parent 9ea58fc commit 8ce16d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/xrCore/Crypto/xr_dsa_signer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,10 @@ shared_str const xr_dsa_signer::sign_mt(u8 const * data,
return m_dsa.sign (m_private_key, m_sha.pointer(), m_sha.digest_length);
}

char const * current_time(string64 & dest_time)
char *current_time(string64 &dest_time)
{
time_t tmp_curr_time;

dest_time[0] = 0;
_time64 (&tmp_curr_time);
tm* tmp_tm = _localtime64(&tmp_curr_time);
const time_t tmp_curr_time = std::time(nullptr);
tm *tmp_tm = std::localtime(&tmp_curr_time);

xr_sprintf(dest_time, sizeof(dest_time),
"%02d.%02d.%d_%02d:%02d:%02d",
Expand Down
4 changes: 2 additions & 2 deletions src/xrCore/Crypto/xr_dsa_signer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ class XRCORE_API xr_dsa_signer

}; //xr_dsa_signer

XRCORE_API char const * current_time(string64 & dest_time);
XRCORE_API char *current_time(string64 &dest_time);

#endif //#ifndef XR_DSA_SIGNER_INCLUDED
#endif //#ifndef XR_DSA_SIGNER_INCLUDED

3 comments on commit 8ce16d1

@Xottab-DUTY
Copy link
Member

Choose a reason for hiding this comment

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

You forgot to include ctime :( Added it in #87

@Kaffeine
Copy link
Member Author

Choose a reason for hiding this comment

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

Hm. Builds for me: https://travis-ci.org/Kaffeine/xray-16/builds/91322969

We have follow include hierarchy:
xr_dsa_signer includes stdafx.h, which includes xrCore.h, which includes Lock.hpp, which uses mutex, which includes chrono (for std::timed_mutex), which includes ctime for system_clock definition.

@Xottab-DUTY
Copy link
Member

Choose a reason for hiding this comment

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

won't build for me :(
Checked hierarchy: the problem is that the chrono does not include ctime. (at least for me) I'm using VS 2015 RC1

Please sign in to comment.