- if(c->protocol_minor >= 2)
- return sptps_send_record(&c->sptps, 0, buffer, length);
-
- /* Add our data to buffer */
- if(c->status.encryptout) {
- size_t outlen = length;
-
- if(!cipher_encrypt(&c->outcipher, buffer, length, buffer_prepare(&c->outbuf, length), &outlen, false) || outlen != length) {
- logger(LOG_ERR, "Error while encrypting metadata to %s (%s)",
- c->name, c->hostname);
- return false;
- }
-
- } else {