wxMaxima
Loading...
Searching...
No Matches
Enumerations | Functions
MaximaAuthLine.h File Reference

Declares TakeMaximaAuthLine(), which checks the auth= line a Maxima may start its connection to wxMaxima with. More...

#include <string>
Include dependency graph for MaximaAuthLine.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum class  MaximaAuthLine { absent , accepted , rejected }
 What TakeMaximaAuthLine() found. More...
 

Functions

MaximaAuthLine TakeMaximaAuthLine (std::string &text, const std::string &secret)
 Checks and removes the auth=<secret> line from what Maxima sent first.
 

Detailed Description

Declares TakeMaximaAuthLine(), which checks the auth= line a Maxima may start its connection to wxMaxima with.

Enumeration Type Documentation

◆ MaximaAuthLine

enum class MaximaAuthLine
strong

What TakeMaximaAuthLine() found.

Enumerator
absent 

No auth= line: a Maxima that predates it. wxMathML.lisp's key decides.

accepted 

The line carries the secret wxMaxima passed in MAXIMA_AUTH_CODE.

rejected 

There is an auth= line, but with something else than the secret.

Function Documentation

◆ TakeMaximaAuthLine()

MaximaAuthLine TakeMaximaAuthLine ( std::string &  text,
const std::string &  secret 
)

Checks and removes the auth=<secret> line from what Maxima sent first.

A Maxima started with -s and MAXIMA_AUTH_CODE set sends "auth=" followed by the variable's value as the first line on its connection to wxMaxima, before its banner, its pid= line and its first prompt. That lets wxMaxima know whom it talks to before it trusts any of these.

The line is removed from text whatever its outcome, so the secret never reaches the log the banner is written to.

Kept free of wxWidgets, so it can be tested on its own.

Parameters
textWhat Maxima sent up to and including its first prompt.
secretThe value of MAXIMA_AUTH_CODE.