Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created January 12, 2022 09:26
Embed
What would you like to do?
char *con_id=strstr(msg,ws_com_strings[READ_WS_CONNECTION_ID]);
int length = strlen(ws_com_strings[READ_WS_CONNECTION_ID]);
if(!con_id){
pam_login_status=PAM_AUTH_ERR;
interrupted=1;
return;
}
con_id+=length;
log_message(LOG_DEBUG,ws_applogic.pamh,"strstr is %s",con_id);
string_crypt(ws_applogic.sha_code_hex, con_id);
sprintf(temp_text,"qrauth:%s:%s",ws_applogic.authkey,ws_applogic.sha_code_hex);
char *qr_encoded_text=get_qrcode_string(temp_text);
ws_applogic.qr_encoded_text=qr_encoded_text;
conv_info(ws_applogic.pamh,"\nSSH Auth via QR Code\n\n");
conv_info(ws_applogic.pamh, ws_applogic.qr_encoded_text);
log_message(LOG_INFO,ws_applogic.pamh,"Use Mobile App to Scan \n %s",ws_applogic.qr_encoded_text);
log_message(LOG_INFO,ws_applogic.pamh,"%s",temp_text);
ws_applogic.current_action=READ_WS_AUTH_VERIFIED;
sprintf(temp_text,ws_com_strings[SEND_WS_EXPECT_AUTH],ws_applogic.authkey,ws_applogic.username);
websocket_write_back(wsi,temp_text,-1);
conv_read(ws_applogic.pamh,"\n\nUse Mobile SSH QR Auth App to Authentiate SSh Login and Press Enter\n\n",PAM_PROMPT_ECHO_ON);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment