Skip to content

Commit

Permalink
print cryptoauthlib version (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
webconn authored Jul 20, 2022
1 parent a4543d2 commit 6ba0ea6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ GIT_VERSION:=$(shell git describe --abbrev=6 --dirty --always --tags)
DEB_VERSION := $(shell head -n 1 debian/changelog | grep -oh -P "\(\K.*(?=\))")
CFLAGS+=-DVERSION=\"$(DEB_VERSION)\ \($(GIT_VERSION)\)\"

# add cryptoauthlib version info from Git
LIBCRYPTOAUTH_VERSION=$(shell git -C $(CRYPTOAUTHDIR) describe --abbrev=6 --dirty --always --tags)
CFLAGS+=-DLIBCRYPTOAUTH_VERSION=\"$(LIBCRYPTOAUTH_VERSION)\"

all: $(TARGET)


Expand Down
5 changes: 5 additions & 0 deletions atecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
#define VERSION "(unknown version)"
#endif

#ifndef LIBCRYPTOAUTH_VERSION
#define LIBCRYPTOAUTH_VERSION "(unknown version)"
#endif

#ifdef USE_OPENSSL
#define WITH_OPENSSL ", with OpenSSL"
#else
Expand Down Expand Up @@ -87,6 +91,7 @@ void print_available_cmds(void)
void print_version(void)
{
eprintf("atecc-util " VERSION WITH_OPENSSL ", build " __DATE__ " " __TIME__ "\n");
eprintf("cryptoauthlib " LIBCRYPTOAUTH_VERSION "\n");
}

int print_help(const char *argv0, const char *cmd_name)
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
atecc-util (0.4.8) stable; urgency=medium

* print cryptoauthlib version in version info

-- Nikita Maslov <nikita.maslov@wirenboard.ru> Tue, 19 Jul 2022 19:09:05 +0300

atecc-util (0.4.7) stable; urgency=medium

* cryptoauthlib: handle 'Watchdog About to Expire' state properly
Expand Down

0 comments on commit 6ba0ea6

Please sign in to comment.