Skip to content

Commit

Permalink
Save work on JWT additions (Issue #50)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Apr 4, 2023
1 parent 4844591 commit 868ace5
Show file tree
Hide file tree
Showing 13 changed files with 1,866 additions and 580 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
/cups/testi18n
/cups/testipp
/cups/testjson
/cups/testjwt
/cups/testlang
/cups/testoptions
/cups/testpwg
Expand Down
29 changes: 28 additions & 1 deletion cups/Dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,32 @@ json.o: json.c cups-private.h string-private.h ../config.h base.h \
\
\
\
pwg-private.h thread.h json.h
pwg-private.h thread.h json-private.h json.h
jwt.o: jwt.c cups-private.h string-private.h ../config.h base.h \
debug-internal.h debug-private.h array.h ipp-private.h cups.h file.h \
ipp.h http.h language.h transcode.h pwg.h http-private.h \
../cups/language.h \
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
pwg-private.h thread.h jwt.h json.h json-private.h
langprintf.o: langprintf.c cups-private.h string-private.h ../config.h \
base.h debug-internal.h debug-private.h array.h ipp-private.h cups.h \
file.h ipp.h http.h language.h transcode.h pwg.h http-private.h \
Expand Down Expand Up @@ -972,6 +997,8 @@ testipp.o: testipp.c file.h base.h string-private.h ../config.h \
test-internal.h
testjson.o: testjson.c cups.h file.h base.h ipp.h http.h array.h \
language.h transcode.h pwg.h json.h test-internal.h
testjwt.o: testjwt.c cups.h file.h base.h ipp.h http.h array.h language.h \
transcode.h pwg.h jwt.h json.h test-internal.h
testoptions.o: testoptions.c cups-private.h string-private.h ../config.h \
base.h debug-internal.h debug-private.h array.h ipp-private.h cups.h \
file.h ipp.h http.h language.h transcode.h pwg.h http-private.h \
Expand Down
16 changes: 16 additions & 0 deletions cups/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ LIBOBJS = \
ipp-file.o \
ipp-support.o \
json.o \
jwt.o \
langprintf.o \
language.o \
md5.o \
Expand Down Expand Up @@ -71,6 +72,7 @@ TESTOBJS = \
testi18n.o \
testipp.o \
testjson.o \
testjwt.o \
testoptions.o \
testraster.o \
testtestpage.o \
Expand Down Expand Up @@ -99,6 +101,7 @@ HEADERS = \
http.h \
ipp.h \
json.h \
jwt.h \
language.h \
ppd.h \
pwg.h \
Expand Down Expand Up @@ -150,6 +153,7 @@ UNITTARGETS = \
testi18n \
testipp \
testjson \
testjwt \
testoptions \
testraster \
testtestpage \
Expand Down Expand Up @@ -196,6 +200,8 @@ test: $(UNITTARGETS)
./testi18n 2>>test.log
echo Running JSON API tests...
./testjson 2>>test.log
# echo Running JWT API tests...
# ./testjwt 2>>test.log
echo Running option API tests...
./testoptions 2>>test.log
echo Running raster API tests...
Expand Down Expand Up @@ -504,6 +510,16 @@ testjson: testjson.o $(LIBCUPS_STATIC)
$(CODE_SIGN) $(CSFLAGS) $@


#
# testjwt (dependency on static CUPS library is intentional)
#

testjwt: testjwt.o $(LIBCUPS_STATIC)
echo Linking $@...
$(CC) $(LDFLAGS) $(OPTIM) -o $@ testjwt.o $(LIBCUPS_STATIC) $(LIBS)
$(CODE_SIGN) $(CSFLAGS) $@


#
# testlang (dependency on static CUPS library is intentional)
#
Expand Down
1 change: 1 addition & 0 deletions cups/cups.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ extern const char *cupsGetUserAgent(void) _CUPS_PUBLIC;

extern ssize_t cupsHashData(const char *algorithm, const void *data, size_t datalen, unsigned char *hash, size_t hashsize) _CUPS_PUBLIC;
extern const char *cupsHashString(const unsigned char *hash, size_t hashsize, char *buffer, size_t bufsize) _CUPS_PUBLIC;
extern ssize_t cupsHMACData(const char *algorithm, const unsigned char *key, size_t keylen, const void *data, size_t datalen, unsigned char *hash, size_t hashsize) _CUPS_PUBLIC;

extern ipp_status_t cupsLastError(void) _CUPS_PUBLIC;
extern const char *cupsLastErrorString(void) _CUPS_PUBLIC;
Expand Down
Loading

0 comments on commit 868ace5

Please sign in to comment.