Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Updated functionality for source address, timeout, retry #159

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akhileshsingh-saithwar
Copy link

@akhileshsingh-saithwar akhileshsingh-saithwar commented Aug 26, 2020

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.

…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 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
@@ -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);
Copy link
Owner

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);
Copy link
Owner

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);
Copy link
Owner

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};
Copy link
Owner

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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants