x11_identify_auth_proto.c 411 B

123456789101112131415161718
  1. /*
  2. * Utility function to convert a textual representation of an X11
  3. * auth protocol name into our integer protocol ids.
  4. */
  5. #include "putty.h"
  6. #include "ssh.h"
  7. int x11_identify_auth_proto(ptrlen protoname)
  8. {
  9. int protocol;
  10. for (protocol = 1; protocol < lenof(x11_authnames); protocol++)
  11. if (ptrlen_eq_string(protoname, x11_authnames[protocol]))
  12. return protocol;
  13. return -1;
  14. }