about summary refs log tree commit diff stats
path: root/src/ui/inputwin.c
Commit message (Expand)AuthorAgeFilesLines
* Show return symbol for embedded newlinesPaul Fertser2022-04-121-1/+24
* Handle input win redisplay via Readline hookPaul Fertser2022-04-121-3/+10
* Show Readline prompt in input windowPaul Fertser2022-04-121-0/+7
* Merge pull request #1664 from paulfertser/tab-completion-cleanupMichael Vetter2022-04-011-41/+11
|\
| * Tab completion code simplificationPaul Fertser2022-03-301-41/+11
* | Merge pull request #1667 from paulfertser/fix-screen-arrows-bindingsMichael Vetter2022-04-011-0/+3
|\ \
| * | Add Alt/Ctrl-arrows combinations for GNU ScreenPaul Fertser2022-03-301-0/+3
| |/
* / Make all existing input functions bindable from configPaul Fertser2022-03-301-0/+5
|/
* Input window: handle invalid multibytePaul Fertser2022-03-291-0/+4
* Add quote autocompletion for previous messagesMarcoPolo-PasTonMolo2022-03-211-1/+26
* Merge pull request #1646 from MarcoPolo-PasTonMolo/fix/nick-autocompleteMichael Vetter2022-03-211-12/+19
|\
| * Reverse priority for nick vs cmd autocompleteMarcoPolo-PasTonMolo2022-03-211-12/+15
| * Fix not autocompleting nicks with '/'MarcoPolo-PasTonMolo2022-03-031-4/+8
* | Alt+e is already bound, use Alt+cSteffen Jaeckel2022-03-131-1/+1
* | Move get_message_from_editor to appropriate file and change its keybindingMarcoPolo-PasTonMolo2022-03-031-4/+4
* | Add hotkey for sending readline text to editorMarcoPolo-PasTonMolo2022-03-031-0/+26
|/
* Format code correctlyMichael Vetter2021-10-051-4/+5
* Change attentionflag shortcut to alt+vMichael Vetter2021-08-311-1/+1
* Attention flag message ( enabled, disabled)DebXWoody2021-05-291-1/+6
* Attention flag - Implemented Alt+mDebXWoody2021-05-291-11/+5
* Attention flagĀ for groupchatsDebXWoody2021-05-291-2/+10
* Attention flag for chat windowsDebXWoody2021-05-291-0/+22
* Set input window size to max window sizekaffeekanne2020-12-111-2/+2
* Since the string from strerror should never be modified, use const.Philipp Klaus Krause2020-10-141-1/+1
* Avoid passing NULL pointers to curses functions.nia2020-09-041-1/+3
* Basic support for building on NetBSD.nia2020-09-041-0/+2
* Apply coding styleMichael Vetter2020-07-071-45/+44
* Revert "Apply coding style"Michael Vetter2020-07-071-57/+58
* Apply coding styleMichael Vetter2020-07-071-58/+57
* Define POSIX macro to have strdupMichael Vetter2020-06-121-2/+2
* inp_readline() Correct slashguard featureMichael Vetter2020-04-211-4/+6
* Make _inp_edited() more robustDmitry Podgorny2020-04-191-1/+8
* Add slashguard featureMichael Vetter2020-03-181-0/+7
* Add vim modelineMichael Vetter2019-11-131-0/+1
* Fix add_history usage in down arrow handlerMichael Vetter2019-11-051-4/+1
* Store current input line in historyMichael Vetter2019-11-051-0/+16
* Bind key to switch to next active windowMichael Vetter2019-09-301-0/+14
* Define keybindings to switch to up to 20 windowsMichael Vetter2019-09-301-0/+100
* Update copyright to include 2019Michael Vetter2019-01-221-1/+1
* Add prof_win_close (#1017)twardziejszy2019-01-101-0/+11
* WIP add self prefs for statusbarJames Booth2018-03-101-2/+2
* Clear autocompletes on line editsJames Booth2018-02-091-3/+19
* Update copyrightJames Booth2018-01-211-1/+1
* Allow previous autocompletion with shift tabJames Booth2017-04-011-2/+49
* Update CopyrightJames Booth2017-01-281-1/+1
* Allow vertical positioning of all windowsJames Booth2016-09-231-10/+4
* Add /inputwin top|bottom commandJames Booth2016-09-191-1/+8
* Move all filepath handling to files.cJames Booth2016-07-241-1/+1
* Move xgd functionsJames Booth2016-07-241-1/+2
* Tidy headersJames Booth2016-07-241-7/+7
*/ FREE(cleartext); /* From previous call. */ /* NOTE: parts of this memory are pointed to by */ /* pointers in HTAAUser structure. Therefore, */ /* this also frees all the strings pointed to */ /* by the static 'user'. */ if (!authstring || !*authstring || scheme != HTAA_BASIC || scheme == HTAA_PUBKEY) return NULL; if (scheme == HTAA_PUBKEY) { /* Decrypt authentication string */ int bytes_decoded; char *ciphertext; int len = strlen(authstring) + 1; if (!(ciphertext = (char*)malloc(len)) || !(cleartext = (char*)malloc(len))) outofmem(__FILE__, "decompose_auth_string"); bytes_decoded = HTUU_decode(authstring, (unsigned char *)ciphertext, len); ciphertext[bytes_decoded] = (char)0; #ifdef PUBKEY HTPK_decrypt(ciphertext, cleartext, private_key); #endif FREE(ciphertext); } else { /* Just uudecode */ int bytes_decoded; int len = strlen(authstring) + 1; if (!(cleartext = (char*)malloc(len))) outofmem(__FILE__, "decompose_auth_string"); bytes_decoded = HTUU_decode(authstring, (unsigned char *)cleartext, len); cleartext[bytes_decoded] = (char)0; } /* ** Extract username and password (for both schemes) */ username = cleartext; if (!(password = strchr(cleartext, ':'))) { if (TRACE) fprintf(stderr, "%s %s\n", "decompose_auth_string: password field", "missing in authentication string.\n"); return NULL; } *(password++) = '\0'; /* ** Extract rest of the fields */ if (scheme == HTAA_PUBKEY) { if ( !(inet_addr =strchr(password, ':')) || (*(inet_addr++) ='\0'), !(timestamp =strchr(inet_addr,':')) || (*(timestamp++) ='\0'), !(browsers_key=strchr(timestamp,':')) || (*(browsers_key++)='\0')) { if (TRACE) fprintf(stderr, "%s %s\n", "decompose_auth_string: Pubkey scheme", "fields missing in authentication string"); return NULL; } } /* ** Set the fields into the result */ user->username = username; user->password = password; user->inet_addr = inet_addr; user->timestamp = timestamp; user->secret_key = browsers_key; if (TRACE) { if (scheme==HTAA_BASIC) fprintf(stderr, "decompose_auth_string: %s (%s,%s)\n", "Basic scheme authentication string:", username, password); else fprintf(stderr, "decompose_auth_string: %s (%s,%s,%s,%s,%s)\n", "Pubkey scheme authentication string:", username, password, inet_addr, timestamp, browsers_key); } return user; } PRIVATE BOOL HTAA_checkTimeStamp ARGS1(CONST char *, timestamp) { return NO; /* This is just a stub */ } PRIVATE BOOL HTAA_checkInetAddress ARGS1(CONST char *, inet_addr) { return NO; /* This is just a stub */ } /* SERVER PUBLIC HTAA_authenticate() ** AUTHENTICATE USER ** ON ENTRY: ** scheme used authentication scheme. ** scheme_specifics the scheme specific parameters ** (authentication string for Basic and ** Pubkey schemes). ** prot is the protection information structure ** for the file. ** ** ON EXIT: ** returns NULL, if authentication failed. ** Otherwise a pointer to a structure ** representing authenticated user, ** which should not be freed. */ PUBLIC HTAAUser *HTAA_authenticate ARGS3(HTAAScheme, scheme, char *, scheme_specifics, HTAAProt *, prot) { if (HTAA_UNKNOWN == scheme || !prot || -1 == HTList_indexOf(prot->valid_schemes, (void*)scheme)) return NULL; switch (scheme) { case HTAA_BASIC: case HTAA_PUBKEY: { HTAAUser *user = decompose_auth_string(scheme_specifics, scheme); /* Remember, user is auto-freed */ if (user && HTAA_checkPassword(user->username, user->password, HTAssocList_lookup(prot->values, "passw")) && (HTAA_BASIC == scheme || (HTAA_checkTimeStamp(user->timestamp) && HTAA_checkInetAddress(user->inet_addr)))) return user; else return NULL; } break; default: /* Other authentication routines go here */ return NULL; } }