pskc_get_key_data_timedrift(3)

πŸ’… pskc_get_key_data_timedrift(3) β€” the libpskc glow-up

okay so bestie, welcome to <pskc.h>'s little corner of libpskc, where we pull the TimeDrift out of a PSKC KeyPackage like it's the last strawberry in the box πŸ“ this is pskc_get_key_data_timedrift(3), and yes she's an API function, and yes she ate.


✨ SYNOPSIS ✨

#include <pskc.h>

uint32_t pskc_get_key_data_timedrift(pskc_key_t * key, int * present);

🫢 ARGUMENTS 🫢

  • pskc_key_t * key β€” a pskc_key_t handle, and you get it from pskc_get_keypackage(). that's the plug, that's where she comes from πŸ”Œ
  • int * present β€” an output variable that tells you whether the data was actually provided or not. she's the receipts holder πŸ’…

🌸 DESCRIPTION 🌸

So what does this actually do? it gets the PSKC KeyPackage Key Data TimeDrift value. that element holds the device clock drift value for time-based OTP algorithms ⏰

and what's in it? an integer value β€” positive or negative drift β€” that tells you the number of time intervals a validation server has established the device clock drifted after the last successful authentication. like, it's the "your clock is a little off, babe" number 😭

the manpage's own example, and I'm keeping it character for character because it's iconic:

So, for example, if the last successful authentication established a device time value of 8 intervals from a specific start date but the validation server determines the time value at 9 intervals, the server SHOULD record the drift as -1.

yeah. 8 vs 9, drift is -1. math is math πŸ“

and about that present pointer: if present is non-NULL, it will be 0 if the field is not present or 1 if it was present. simple as that, no cap 🧚


πŸ‘‘ RETURNS πŸ‘‘

an integer holding the content. that's the whole vibe check β€” one integer, fully holding the content πŸ’–


πŸ”₯ REPORTING BUGS πŸ”₯

found a bug? don't just scream into the group chat, report bugs to <oath-toolkit-help@nongnu.org> πŸ“¬


Copyright Β© 2009-2026 Simon Josefsson.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. (yes, that's the whole license, she's short and she's free πŸ’œ)


🌈 and that's the page, bestie! this little manual is from libpskc, version 2.6.15, and it's the man page for pskc_get_key_data_timedrift(3). go forth and check that drift, mama πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from