Commit Graph

288 Commits (master)
 

Author SHA1 Message Date
Michael Santos 25dbece040 chat: fix segfault when domain is not provided
Running xmppipe in chat mode without a full jid:

    xmppipe --chat --output foo

Caused a segfault when a NULL domain was passed to
xmpp_stanza_set_attribute(). The libstrophe functions do not check for
NULL and so crash calling strlen(NULL).

Set the jid's domain from the user's username. If the user's jid is
user@example.com:

    # expanded to foo@example.com
    xmppipe --chat --output foo
6 years ago
Michael Santos 29280e2edc Document --chat option
Document usage of one to one chat:

    xmppipe --chat --output me@example.com

Only provide the long option until a few quirks have been worked out:

* if only a username is provided, it will be expanded to a conference
  name

    # expands to me@conference.example.com
    xmppipe --chat --output me

* should "normal" and "headline" message types also be supported?

* tests
6 years ago
Michael Santos 871569e3b5 README: cleanup 6 years ago
Michael Santos ba02827064 README: example of sending notifications 6 years ago
Michael Santos 3f7ef5ca7b debug: print state names 6 years ago
Michael Santos de9fa9ab30 Fixes for ejabberd 18.04
* always add id in iq stanzas.

* presence: response from muc may contain more than one 'x' element,
  match stanza by namespace

* debug: print out current state
6 years ago
Michael Santos 169c6dd69e README: example of notifications 6 years ago
Michael Santos 47102efc69 Set line buffered mode 6 years ago
Michael Santos 0984bc763b examples: script clean up 6 years ago
Michael Santos 97fa38c86a Support one-to-one chats
Add preliminary support to one to one chats. No XEPs were read in the
preparation of this change:

    xmppipe -C example@example.com

TODO
* clean up
    * state change is hardcoded
    * if (GROUPCHAT) branches
* autodetect MUC
* in chat mode, ctrl-D can cause a loop
6 years ago
Michael Santos 4a8d1f910f xmppipe_conn_fd: get highest open fd 6 years ago
Michael Santos 3797fc4151 macosx: fix compile errors 6 years ago
Michael Santos 38cd570d28 seccomp: allow restart_syscall in stdin sandbox 6 years ago
Michael Santos cc828f582f seccomp: allow restart_syscall 6 years ago
Michael Santos 9ae3dcc1a1 seccomp: raspbian: allow futex(2), sysinfo(2) 6 years ago
Michael Santos da9d2f8e88 makefile: pass custom LDFLAGS to static build 7 years ago
Michael Santos 2d67d64ecb Bump version to 0.9.3 7 years ago
Michael Santos 77c76d6626 makefile: enable full relro 7 years ago
Michael Santos f0e7ef7c4c Use -fstack-protector-strong 7 years ago
Michael Santos 2933964bca capscicum: return result of setlrimit() 7 years ago
Michael Santos efd009594b makefile: fix static target 7 years ago
Michael Santos 3e1eea1069 sandbox/rlimit: return value of setrlimit() 7 years ago
Michael Santos 93c6e1378b makefile: define behaviour for signed ints 7 years ago
Michael Santos 60895c46e4 README: use long options, bump version
Bump version for sandbox compilation changes.
7 years ago
Michael Santos ec32315684 sandbox: use the lowercase name for configuration 7 years ago
Michael Santos f0092fd58a seccomp: adjust header for syscalls 7 years ago
Michael Santos fa2ebb799d Use libstrophe base64 support
Use the base64 interface in libstrophe for encoding/decoding instead of
the undocumented interfaces in libresolv.
7 years ago
Michael Santos e28f208103 Optionally disable TLS cert verification 7 years ago
Michael Santos 3fa5755655 sandbox/rlimit: remove redundant code, ifdef's 7 years ago
Michael Santos 2cf8dc3f0b Merge pull request #2 from pasis/attr-fix
Fix getting wrong attribute from stanza
7 years ago
Dmitry Podgorny cca644045f Fix getting wrong attribute from stanza 7 years ago
Michael Santos c184ce68b2 Depend on libstrophe 0.9.2+
libstrophe 0.9.2 supports TLS certificate verification. Tested by:

* valid certificate: verified using strace that xmppipe is reading the
  system SSL cert store

* invalid certificate:

    sudo chmod 700 /usr/lib/ssl

  Verified xmppipe rejected the cert as invalid without the local CA
  root.

* valid certificate, invalid domain

  Verified a subdomain hosted on the XMPP node but not included in the
  TLS certificate is rejected.
7 years ago
Michael Santos 0ad3918c05 Fix options
Terminate long option list so xmppipe doesn't segfault when passed an
unknown option.

Correct the usage. Revert to using --ouput for the MUC name instead of
--stdout to avoid confusion.
7 years ago
Michael Santos 1d89c8cf96 cli: --output -> --stdout 7 years ago
Michael Santos 9fa747fd5c seccomp: allow llseek(2) for TLS verification
libstrophe 0.9.2 uses OpenSSL to validate TLS certs by checking against
the system cert store.

Allow llseek(2). Probably a better way of handling syscalls is to allow
classes of syscalls based on OpenBSD's pledge.
7 years ago
Michael Santos a6b81e9fbb Merge branch 'pasis-uuid' 7 years ago
Dmitry Podgorny ef78dc7deb Replace libuuid with xmpp_uuid_gen()
xmpp_uuid_gen() appeared in libstrophe-0.9.0 and solves issues with
libuuid across different systems.
7 years ago
Michael Santos f201c6a483 Add support for long options 7 years ago
Michael Santos 41a6897bc1 Use native strtonum(3) on BSDs 7 years ago
Michael Santos 78978f725d sandbox: ignore return value of cap_rights_init(3) 7 years ago
Michael Santos 70423ab6a7 capsicum: remove duplicated process rlimit 7 years ago
Michael Santos 26ef980678 makefile: env vars to pass extra build flags 7 years ago
Michael Santos db0769c1fd makefile: fix static target 7 years ago
Michael Santos 3e9f34f1fb openbsd/freebsd: cc hardening flags 7 years ago
Michael Santos e98a6b24fa Increment version for pre-connect sandbox 7 years ago
Michael Santos 20f8b5904c Increment version for pre-connect sandbox 7 years ago
Michael Santos 81b4c2f4db seccomp sandbox: allow sendmmsg(2) 7 years ago
Michael Santos e3e3d0bcf9 seccomp: pre-connect sandbox
Preliminary pre-connect sandbox for Linux. Tested on 32-bit ARM,
requires testing on other platforms.
7 years ago
Michael Santos 140470458f makefile: ensure compile before tests 7 years ago
Michael Santos f734b5b77b freebsd: disable forking in preconnect sandbox 7 years ago