+ if(!ecdsa_sign(&myself->connection->ecdsa, key, ECDH_SIZE, sig))
+ return false;
+
+ char out[MAX_STRING_SIZE];
+
+ bin2hex(key, out, ECDH_SIZE);
+ bin2hex(sig, out + ECDH_SIZE * 2, siglen);
+ out[(ECDH_SIZE + siglen) * 2] = 0;
+
+ bool result = send_request(c, "%d %s", METAKEY, out);
+}
+
+bool send_metakey(connection_t *c) {
+ size_t len = rsa_size(&c->rsa);
+ char key[len];
+ char enckey[len];
+ char hexkey[2 * len + 1];
+
+ if(!read_rsa_public_key(c))
+ return false;
+
+ if(!cipher_open_blowfish_ofb(&c->outcipher))
+ return false;
+
+ if(!digest_open_sha1(&c->outdigest, -1))
+ return false;
+
+ /* Create a random key */
+
+ randomize(key, len);