Skip to content
Snippets Groups Projects
Select Git revision
  • ff68c47c0c47d84f1b5ca6886edb7659af6ebd95
  • master default
  • wip-slh-dsa-sha2-128s
  • master-updates
  • release-3.10-fixes
  • getopt-prototype
  • fix-bcrypt-warning
  • refactor-hmac
  • wip-use-alignas
  • trim-sha3-context
  • fix-gitlab-ci
  • check-fat-emulate
  • delete-digest_func-size
  • slh-dsa-shake-128f-nettle
  • slh-dsa-shake-128s-nettle
  • slh-dsa-shake-128s
  • delete-openpgp
  • ppc64-sha512
  • delete-md5-compat
  • cleanup-hmac-tests
  • ppc64-sha256
  • nettle_3.10.2_release_20250626
  • nettle_3.10.1_release_20241230
  • nettle_3.10_release_20240616
  • nettle_3.10rc2
  • nettle_3.10rc1
  • nettle_3.9.1_release_20230601
  • nettle_3.9_release_20230514
  • nettle_3.8.1_release_20220727
  • nettle_3.8_release_20220602
  • nettle_3.7.3_release_20210606
  • nettle_3.7.2_release_20210321
  • nettle_3.7.1_release_20210217
  • nettle_3.7_release_20210104
  • nettle_3.7rc1
  • nettle_3.6_release_20200429
  • nettle_3.6rc3
  • nettle_3.6rc2
  • nettle_3.6rc1
  • nettle_3.5.1_release_20190627
  • nettle_3.5_release_20190626
41 results

ed25519-sha512-sign.c

Blame
  • TELNET.pmod 35.49 KiB
    //
    // The TELNET protocol as described by RFC 764 and others.
    //
    // Henrik Grubbström <grubba@roxen.com> 1998-04-04
    //
    
    #pike __REAL_VERSION__
    
    // #define TELNET_DEBUG
    
    #ifdef TELNET_DEBUG
    #define DWRITE(X ...)	werror("TELNET: " X)
    #else
    #define DWRITE(X ...)
    #endif /* TELNET_DEBUG */
    
    //! Implements TELNET as described by RFC 764 and RFC 854
    //!
    //! Also implements the Q method of TELNET option negotiation
    //! as specified by RFC 1143.
    
    /* Extract from RFC 1143:
     *
     * EXAMPLE STATE MACHINE FOR THE Q METHOD OF IMPLEMENTING
     * TELNET OPTION NEGOTIATION 
     *
     * There are two sides, we (us) and he (him).  We keep four variables:
     *
     *    us: state of option on our side (NO/WANTNO/WANTYES/YES)
     *    usq: a queue bit (EMPTY/OPPOSITE) if us is WANTNO or WANTYES
     *    him: state of option on his side
     *    himq: a queue bit if him is WANTNO or WANTYES
     *
     * An option is enabled if and only if its state is YES.  Note that
     * us/usq and him/himq could be combined into two six-choice states.
     *
     * "Error" below means that producing diagnostic information may be a
     * good idea, though it isn't required.
     *
     * Upon receipt of WILL, we choose based upon him and himq:
     *    NO            If we agree that he should enable, him=YES, send
     *                  DO; otherwise, send DONT.
     *    YES           Ignore.
     *    WANTNO  EMPTY Error: DONT answered by WILL. him=NO.
     *         OPPOSITE Error: DONT answered by WILL. him=YES*,
     *                  himq=EMPTY.
     *    WANTYES EMPTY him=YES.
     *         OPPOSITE him=WANTNO, himq=EMPTY, send DONT.
     *
     * * This behavior is debatable; DONT will never be answered by WILL
     *   over a reliable connection between TELNETs compliant with this
     *   RFC, so this was chosen (1) not to generate further messages,
     *   because if we know we're dealing with a noncompliant TELNET we
     *   shouldn't trust it to be sensible; (2) to empty the queue
     *   sensibly.
     *
     * Upon receipt of WONT, we choose based upon him and himq:
     *    NO            Ignore.
     *    YES           him=NO, send DONT.
     *    WANTNO  EMPTY him=NO.
     *         OPPOSITE him=WANTYES, himq=NONE, send DO.
     *    WANTYES EMPTY him=NO.*
     *         OPPOSITE him=NO, himq=NONE.**
     *
     * * Here is the only spot a length-two queue could be useful; after
     *   a WILL negotiation was refused, a queue of WONT WILL would mean
     *   to request the option again. This seems of too little utility
     *   and too much potential waste; there is little chance that the
     *   other side will change its mind immediately.
     *