summaryrefslogtreecommitdiff
path: root/libtac
AgeCommit message (Collapse)Author
2017-12-31Fix 'unused' warnings when building with clang/llvmPhilip Prindeville
2017-12-29RAND_pseudo_bytes() has been deprecated in OpenSSL 1.1.0. They tell usMartin Belanger
to use RAND_bytes() instead. Modified by Philip Prindeville <philipp@redfish-solutions.com>
2017-12-29linux/random.h doesn't actually declare getrandom()Philip Prindeville
2017-12-29Fix compile-time warningsPhilip Prindeville
2017-06-15Do not set password for ASCII loginKyeong Yoo
For ASCII login, data field is not used ([1] Section 9.0.2 Inbound ASCII Login). So do not add the user password for the login authentication with type ASCII. [1] https://tools.ietf.org/html/draft-grant-tacacs-02
2016-12-20Merge pull request #80 from pprindeville/reorg-magicPhilip Prindeville
Reorg magic
2016-12-20Merge pull request #85 from pprindeville/add-runtime-debuggingPhilip Prindeville
Add runtime debugging
2016-12-12Allow building with run-time debugging enabled (via configure)Philip Prindeville
Add --enable-runtime-debugging option to ./configure. Add example logmsg() to tacc.c so it can be built with debugging. Fix logmsg() prototype (it's supposed to match the prototype of syslog() which returns void). Export build-time value of --enable-runtime-debugging into libtac.pc.
2016-12-11Fix damage from PR #71Philip Prindeville
2016-12-05Provide magic function when compiling against opensslPhilip Prindeville
2016-12-05Simplify initialization of magic functionPhilip Prindeville
The pseudo-random number function magic() needs to be primed via magic_init() before being invoked. The standard (but klunky) way of handling this is with a static bool inside the function which indicates whether initialization has happened, and if not, handles initialization and then sets the flag. Sometimes it's more desireable to have initialization happen in a known order before program execution starts (this helps with reproducibility). We can do this by indicating to the compiler/ linker that particular functions need to be executed after __start() but before main().
2016-12-05Fix sense of test for header and libraryPhilip Prindeville
2016-11-11Fix ASCII logins where 2 transactions are requiredPhilip Prindeville
authenticate() doesn't handle the case of an ASCII login which results in a continue request being required to complete the transaction.
2016-10-17Fix regression introduced when doing incremental encryptionPhilip Prindeville
Wrong subscript (subscript of digest should always be modulo digest size [16 bytes]).
2016-10-05Merge pull request #65 from pprindeville/simplify-md5-operationsPaweł Krawczyk
Various cryptography improvements
2016-10-04Make TACDEBUG and TACSYSLOG into varargs macrosPhilip Prindeville
Also, correct the -DTACDEBUG_AT_RUNTIME scenario so that TACDEBUG() binds correct when used in an if-body with an else following it, e.g.: if (test) TACDEBUG(LOG_DEBUG, "test is true"); else return; would previously have ended up as expanding to: if (test) if (tac_debug_enable) logmsg(LOG_DEBUG, "test is true"); else return; with the indent redone to reflect the nesting correctly. This now expands (correctly) to: if (test) do { if (tac_debug_enable) logmsg(LOG_DEBUG, "test is true"); } while (0); else return;
2016-10-04Modularize computing CHAP digestPhilip Prindeville
It's easier to read, debug, and maintain that way. Also, avoid unnecessary marshalling while we're at it, since MD5Update() can be called iteratively, which obviates having to gather the data to be digested into a contiguous buffer.
2016-10-04Don't compute pad all at once when we can compute it incrementallyPhilip Prindeville
This saves us having to marshall data and allocate a buffer for the entire pad (bitstream cipher). We only need it in blocks of 16 bytes (the size of the MD5 digest), so let's compute it piecemeal as we need it. This has the added benefit of avoiding any calls to malloc() which might be result in system calls (i.e. sbrk() to extend the heap).
2016-10-04No need to pass in payload length when the header already includes itPhilip Prindeville
Why make copies of the payload length to pass as parameters when it's already present in the header?
2016-10-04Avoid unnecessary marshalling when computing Tacacs padPhilip Prindeville
MD5Update supports incremental digesting, so we can invoke it multiple times to collect data rather than having to marshall it into a contiguous buffer.
2016-10-04MD5Update doesn't modify the data it's digestingPhilip Prindeville
So make that parameter be 'const' instead.
2016-10-05Merge pull request #68 from pprindeville/more-cleanupjeroennijhof
More factoring of the cleanup code for tac_connect_single
2016-10-05Don't init declarations in a for loopJeroen Nijhof
2016-10-04More factoring of the cleanup code for tac_connect_singlePhilip Prindeville
Commit 654b79e removed a very similar check, but with the new common exit strategy for this function, it is in fact possible to have fd be set without having copied fd into retval (i.e. retval still being set to an error value, which is negative).
2016-10-04Exit tac_connect_single consistently via bottom of functionPhilip Prindeville
This is so that tracing is always the same, even when exceptions occur.
2016-10-04Merge pull request #64 from pprindeville/add-stricter-warningsjeroennijhof
Turn on stricter compiler warnings
2016-09-30Fix build breakage when compiling without openssl-develPhilip Prindeville
Fix the prototyping in lib/md5.h. Accommodate the function name differences between lib/md5.h and the equivalent functions in openssl/md5.h. Accommodate replacement of MD5_LEN with MD5_LBLOCK (note that MD5_CBLOCK and MD5_DIGEST_LEN aren't referenced) and use this consistently.
2016-09-29Turn on stricter compiler warningsPhilip Prindeville
And fix subsequent warnings caused by: - shadowed variables (i.e. variables existing in nested scopes); - signed vs. unsigned comparisons - string pointers and buffers being unsigned which don't need to be; - unnecessary casts; - unused variables (or only used when debugging is enabled);
2016-07-23source formattingPaweł Krawczyk
2016-07-23initialize timelimitPaweł Krawczyk
2016-07-23timeleft may be potentially used uninitializedPaweł Krawczyk
2016-07-23dead assignment - 'a' is overwritten shortly afterPaweł Krawczyk
2016-07-23dead assignment - deltausecs is overwritten shortly afterPaweł Krawczyk
2016-07-23check loop against TAC_PLUS_MAX_ARGCOUNTPaweł Krawczyk
2016-07-23check for max number of arguments passed in replyPaweł Krawczyk
2016-07-23Fix warningsPaweł Krawczyk
Fix various declaration inconsistencies that were throwing compiler warnings
2016-07-22Rewrite the getrandom(2) usagePaweł Krawczyk
The getrandom(2) is experimental (on Linux at least) and the presence of headers doesn't guarantee it's usable. It seems to be available from 3.17 kernels only as syscall.
2016-07-22check for sys/random.h as well for SolarisPaweł Krawczyk
2016-07-22fix format string for long intPaweł Krawczyk
2016-07-22license libtac on LGPLPaweł Krawczyk
2016-05-27fix variable namesPaweł Krawczyk
2016-05-27wrong var namePaweł Krawczyk
2016-05-27typoPaweł Krawczyk
2016-05-27max packet sizePaweł Krawczyk
2016-05-27replace the broken packet_read check with a hard-coded max packet lengthPaweł Krawczyk
2016-05-05Merge branch 'master' of github.com:jeroennijhof/pam_tacplusPaweł Krawczyk
2016-05-05make len_from_* variables unsignedPaweł Krawczyk
2016-05-05make len_from_* variables unsignedPaweł Krawczyk
2016-05-05format string long intPaweł Krawczyk
2016-05-04fix variable referencePaweł Krawczyk