Deleted Added
full compact
t1_ext.c (306343) t1_ext.c (325335)
1/* ssl/t1_ext.c */
2/* ====================================================================
3 * Copyright (c) 2014 The OpenSSL Project. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 165 unchanged lines hidden (view full) ---

174 meth->ext_flags |= SSL_EXT_FLAG_SENT;
175 if (meth->free_cb)
176 meth->free_cb(s, meth->ext_type, out, meth->add_arg);
177 }
178 *pret = ret;
179 return 1;
180}
181
1/* ssl/t1_ext.c */
2/* ====================================================================
3 * Copyright (c) 2014 The OpenSSL Project. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *

--- 165 unchanged lines hidden (view full) ---

174 meth->ext_flags |= SSL_EXT_FLAG_SENT;
175 if (meth->free_cb)
176 meth->free_cb(s, meth->ext_type, out, meth->add_arg);
177 }
178 *pret = ret;
179 return 1;
180}
181
182/* Copy the flags from src to dst for any extensions that exist in both */
183int custom_exts_copy_flags(custom_ext_methods *dst,
184 const custom_ext_methods *src)
185{
186 size_t i;
187 custom_ext_method *methsrc = src->meths;
188
189 for (i = 0; i < src->meths_count; i++, methsrc++) {
190 custom_ext_method *methdst = custom_ext_find(dst, methsrc->ext_type);
191
192 if (methdst == NULL)
193 continue;
194
195 methdst->ext_flags = methsrc->ext_flags;
196 }
197
198 return 1;
199}
200
182/* Copy table of custom extensions */
183int custom_exts_copy(custom_ext_methods *dst, const custom_ext_methods *src)
184{
185 if (src->meths_count) {
186 dst->meths =
187 BUF_memdup(src->meths,
188 sizeof(custom_ext_method) * src->meths_count);
189 if (dst->meths == NULL)

--- 28 unchanged lines hidden (view full) ---

218 if (SSL_extension_supported(ext_type))
219 return 0;
220 /* Extension type must fit in 16 bits */
221 if (ext_type > 0xffff)
222 return 0;
223 /* Search for duplicate */
224 if (custom_ext_find(exts, ext_type))
225 return 0;
201/* Copy table of custom extensions */
202int custom_exts_copy(custom_ext_methods *dst, const custom_ext_methods *src)
203{
204 if (src->meths_count) {
205 dst->meths =
206 BUF_memdup(src->meths,
207 sizeof(custom_ext_method) * src->meths_count);
208 if (dst->meths == NULL)

--- 28 unchanged lines hidden (view full) ---

237 if (SSL_extension_supported(ext_type))
238 return 0;
239 /* Extension type must fit in 16 bits */
240 if (ext_type > 0xffff)
241 return 0;
242 /* Search for duplicate */
243 if (custom_ext_find(exts, ext_type))
244 return 0;
226 exts->meths = OPENSSL_realloc(exts->meths,
227 (exts->meths_count +
228 1) * sizeof(custom_ext_method));
229
230 if (!exts->meths) {
231 exts->meths_count = 0;
245 meth = OPENSSL_realloc(exts->meths,
246 (exts->meths_count + 1)
247 * sizeof(custom_ext_method));
248 if (meth == NULL)
232 return 0;
249 return 0;
233 }
234
250
235 meth = exts->meths + exts->meths_count;
251 exts->meths = meth;
252 meth += exts->meths_count;
236 memset(meth, 0, sizeof(custom_ext_method));
237 meth->parse_cb = parse_cb;
238 meth->add_cb = add_cb;
239 meth->free_cb = free_cb;
240 meth->ext_type = ext_type;
241 meth->add_arg = add_arg;
242 meth->parse_arg = parse_arg;
243 exts->meths_count++;

--- 57 unchanged lines hidden ---
253 memset(meth, 0, sizeof(custom_ext_method));
254 meth->parse_cb = parse_cb;
255 meth->add_cb = add_cb;
256 meth->free_cb = free_cb;
257 meth->ext_type = ext_type;
258 meth->add_arg = add_arg;
259 meth->parse_arg = parse_arg;
260 exts->meths_count++;

--- 57 unchanged lines hidden ---