This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 101
Updated functionality for source address, timeout, retry #159
Open
akhileshsingh-saithwar
wants to merge
1
commit into
kravietz:master
Choose a base branch
from
akhileshsingh-saithwar:src_addr_fix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Updated functionality for source address, timeout, retry #159
akhileshsingh-saithwar
wants to merge
1
commit into
kravietz:master
from
akhileshsingh-saithwar:src_addr_fix
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…dded retry counter of 3 per server. 3. Added debug log messages. 4. Added encrypition/decryption for secrete key. 5. Added support to add source address in the configuration file. 6. Added error messages if the secrete key is not configured, server not configured.
akhileshsingh-saithwar
changed the title
Updated functionality for 1. Added timeout/server configutation. 2. A…
Updated functionality for source address, timeout, retry
Aug 26, 2020
kravietz
suggested changes
Aug 27, 2020
@@ -341,41 +372,77 @@ int _pam_parse(int argc, const char **argv) { | |||
} | |||
} else if (!strncmp(*argv, "secret=", 7)) { | |||
current_secret = *argv + 7; /* points right into argv (which is const) */ | |||
|
|||
strncpy(key,current_secret,TAC_SECRET_MAX_LEN); | |||
_tac_string_decrypt(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please pass TAC_SECRET_MAX_LEN
into the _tac_string_decrypt()
function
char buf[64]={0}; | ||
TACSYSLOG(LOG_WARNING, "%s: Input key %s", __FUNCTION__,(char*)key); | ||
|
||
strcpy(buf,key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use strncpy
for(j=2;j<=6 && i < strlen(buf);j++) | ||
buf[i++]-=j; | ||
} | ||
strcpy(key,buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use strncpy
|
||
void _tac_string_decrypt(char *key) { | ||
unsigned i, j; | ||
char buf[64]={0}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use TAC_SECRET_MAX_LEN+1
instead of hardcoded length
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added timeout/server configutation. 2. Added retry counter of 3 per server. 3. Added debug log messages. 4. Added encrypition/decryption for secrete key. 5. Added support to add source address in the configuration file. 6. Added error messages if the secrete key is not configured, server not configured.