summaryrefslogtreecommitdiffstats
path: root/ssl/t1_ext.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-09-28 11:15:36 +0100
committerMatt Caswell <matt@openssl.org>2016-09-29 10:06:46 +0100
commit150e298551a6788baac56c0c89dc8b8342ac0079 (patch)
tree6fb339afc76f4b3caffaef1dfd0f24c29e9ddb30 /ssl/t1_ext.c
parent8157d44b624da08142f3f9f6edc37fb5542c2573 (diff)
Delete some unneeded code
Some functions were being called from both code that used WPACKETs and code that did not. Now that more code has been converted to use WPACKETs some of that duplication can be removed. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'ssl/t1_ext.c')
-rw-r--r--ssl/t1_ext.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/ssl/t1_ext.c b/ssl/t1_ext.c
index 099a0ae086..30b304669f 100644
--- a/ssl/t1_ext.c
+++ b/ssl/t1_ext.c
@@ -72,71 +72,6 @@ int custom_ext_parse(SSL *s, int server,
/*
* Request custom extension data from the application and add to the return
- * buffer. This is the old style function signature prior to WPACKET. This is
- * here temporarily until the conversion to WPACKET is completed, i.e. it is
- * used by code that hasn't been converted yet.
- * TODO - REMOVE THIS FUNCTION
- */
-int custom_ext_add_old(SSL *s, int server,
- unsigned char **pret, unsigned char *limit, int *al)
-{
- custom_ext_methods *exts = server ? &s->cert->srv_ext : &s->cert->cli_ext;
- custom_ext_method *meth;
- unsigned char *ret = *pret;
- size_t i;
-
- for (i = 0; i < exts->meths_count; i++) {
- const unsigned char *out = NULL;
- size_t outlen = 0;
- meth = exts->meths + i;
-
- if (server) {
- /*
- * For ServerHello only send extensions present in ClientHello.
- */
- if (!(meth->ext_flags & SSL_EXT_FLAG_RECEIVED))
- continue;
- /* If callback absent for server skip it */
- if (!meth->add_cb)
- continue;
- }
- if (meth->add_cb) {
- int cb_retval = 0;
- cb_retval = meth->add_cb(s, meth->ext_type,
- &out, &outlen, al, meth->add_arg);
- if (cb_retval < 0)
- return 0; /* error */
- if (cb_retval == 0)
- continue; /* skip this extension */
- }
- if (4 > limit - ret || outlen > (size_t)(limit - ret - 4))
- return 0;
- s2n(meth->ext_type, ret);
- s2n(outlen, ret);
- if (outlen) {
- memcpy(ret, out, outlen);
- ret += outlen;
- }
- /*
- * We can't send duplicates: code logic should prevent this.
- */
- OPENSSL_assert(!(meth->ext_flags & SSL_EXT_FLAG_SENT));
- /*
- * Indicate extension has been sent: this is both a sanity check to
- * ensure we don't send duplicate extensions and indicates that it is
- * not an error if the extension is present in ServerHello.
- */
- meth->ext_flags |= SSL_EXT_FLAG_SENT;
- if (meth->free_cb)
- meth->free_cb(s, meth->ext_type, out, meth->add_arg);
- }
- *pret = ret;
- return 1;
-}
-
-
-/*
- * Request custom extension data from the application and add to the return
* buffer.
*/
int custom_ext_add(SSL *s, int server, WPACKET *pkt, int *al)