• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/Security-57031.1.35/Security/libsecurity_ssl/security_ssl/

Lines Matching refs:ctx

51               struct SSLRecordInternalContext  *ctx)
57 ortn = (ctx->read)(ctx->ioRef,
63 ctx, buf.length, dataLength, (int)ortn);
71 struct SSLRecordInternalContext *ctx)
77 ortn = (ctx->write)(ctx->ioRef,
83 ctx, buf.length, dataLength, (int)ortn);
92 struct SSLRecordInternalContext *ctx = ref;
98 size_t head=tls_record_get_header_size(ctx->filter);
100 if (ctx->amountRead < head)
102 readData.length = head - ctx->amountRead;
103 readData.data = ctx->partialReadBuffer.data + ctx->amountRead;
105 err = sslIoRead(readData, &len, ctx);
110 ctx->amountRead += len;
119 ctx->amountRead += len;
121 check(ctx->amountRead == head);
126 header.data=ctx->partialReadBuffer.data;
131 tls_record_parse_header(ctx->filter, header, &contentLen, &content_type);
136 err=tls_record_parse_ssl2_header(ctx->filter, header, &contentLen, &content_type);
140 check(ctx->partialReadBuffer.length>=head+contentLen);
142 if(head+contentLen>ctx->partialReadBuffer.length)
145 if (ctx->amountRead < head + contentLen)
146 { readData.length = head + contentLen - ctx->amountRead;
147 readData.data = ctx->partialReadBuffer.data + ctx->amountRead;
149 err = sslIoRead(readData, &len, ctx);
152 ctx->amountRead += len;
155 ctx->amountRead += len;
158 check(ctx->amountRead == head + contentLen);
161 record.data = ctx->partialReadBuffer.data;
162 record.length = ctx->amountRead;
166 ctx->amountRead = 0; /* We've used all the data in the cache */
172 size_t sz = tls_record_decrypted_size(ctx->filter, record.length);
177 if(ctx->dtls) {
192 return tls_record_decrypt(ctx->filter, record, &rec->contents, NULL);
199 struct SSLRecordInternalContext *ctx = ref;
206 len=tls_record_encrypted_size(ctx->filter, rec.contentType, rec.contents.length);
219 require_noerr((err=tls_record_encrypt(ctx->filter, content, rec.contentType, &data)), fail);
224 if (ctx->recordWriteQueue == 0)
225 ctx->recordWriteQueue = out;
227 { queue = ctx->recordWriteQueue;
245 struct SSLRecordInternalContext *ctx = ref;
246 return tls_record_rollback_write_cipher(ctx->filter);
252 struct SSLRecordInternalContext *ctx = ref;
253 return tls_record_advance_write_cipher(ctx->filter);
259 struct SSLRecordInternalContext *ctx = ref;
260 return tls_record_advance_read_cipher(ctx->filter);
266 struct SSLRecordInternalContext *ctx = ref;
267 return tls_record_init_pending_ciphers(ctx->filter, selectedCipher, isServer, key);
273 struct SSLRecordInternalContext *ctx = ref;
274 return tls_record_set_protocol_version(ctx->filter, negVersion);
290 struct SSLRecordInternalContext *ctx= ref;
292 while (!werr && ((rec = ctx->recordWriteQueue) != 0))
295 werr = sslIoWrite(buf, &written, ctx);
301 ctx->recordWriteQueue = rec->next;
316 struct SSLRecordInternalContext *ctx = (struct SSLRecordInternalContext *)ref;
319 return tls_record_set_record_splitting(ctx->filter, value);
335 struct SSLRecordInternalContext *ctx;
337 ctx = sslMalloc(sizeof(struct SSLRecordInternalContext));
338 if(ctx==NULL)
341 memset(ctx, 0, sizeof(struct SSLRecordInternalContext));
343 ctx->dtls = dtls;
344 require((ctx->filter=tls_record_create(dtls, CCRNGSTATE)), fail);
345 require_noerr(SSLAllocBuffer(&ctx->partialReadBuffer,
348 return ctx;
351 if(ctx->filter)
352 tls_record_destroy(ctx->filter);
353 sslFree(ctx);
363 struct SSLRecordInternalContext *ctx = ref;
365 ctx->read = readFunc;
366 ctx->write = writeFunc;
376 struct SSLRecordInternalContext *ctx = ref;
378 ctx->ioRef = ioRef;
386 struct SSLRecordInternalContext *ctx = ref;
390 SSLFreeBuffer(&ctx->partialReadBuffer);
391 waitRecord = ctx->recordWriteQueue;
398 if(ctx->filter)
399 tls_record_destroy(ctx->filter);
401 sslFree(ctx);