Get system date / time via USB

Is there a way to request the system date / time via USB without installing anything on the host computer (maybe just drivers)?


Background of the original problem

To avoid the XY problem , let me explain a little what I'm trying to do.

In order to be able to calculate the TOTP token for 2FA (for example, like the Google Authenticator app), you need a real-time clock to get the date and time.

There it is a USB device called SC4-HSM, which I would like to use to calculate tokens, but it does not have a clock and, according to the designer, adding one of them would be too expensive (battery is required, etc.).

Possible solution to the original problem

This device will be used with a computer that, of course, has RTC. So, I had an idea to request a system for a date / time that would solve the problem.

(Note: I know that a USB device can be connected to different hosts, and not all hosts will have RTC, but since this is only necessary for working with a computer, I thought that this should not be a problem)

My first thought was that there might be some class of USB device that had date and time needs, so I could register the device as this type, and then I could request the values.

After going through the list of device class classes, I didn’t bounce anything, because I need a date and time. The closest I could think of were:

  • Content Security
  • Personal health
  • Smart card class

USB-, .

USB , , , , USB-, , , /, ( - ).

USB, USB- Michael Opdenacker Linux, USB USB, . Skimmed Windows NT , , , , .

, , , - , , , ?

, , .

/ ?

+6
1

, "" , NTP.

, Linux, , .

https://askubuntu.com/questions/642511/how-to-autorun-files-and-scripts-in-ubuntu-when-inserting-a-usb-stick-like-autor

linux date hwclock , , NTP ( )

SC4-HSM. , USB SC4-HSM , CDC ACM ( COM-), : Arduino USB

(- echo "T$(($(date +%s)+60*60*$TZ_adjust))" >/dev/tty.usbmodemfa131)

, USB-,

+1

Source: https://habr.com/ru/post/1662024/


All Articles