Crypt-MatrixSSL
view release on metacpan or search on metacpan
matrixssl-1-8-6-open/src/crypto/peersec/arc4.c view on Meta::CPAN
/*
Some accounts, such as O'Reilly's Secure Programming Cookbook say that no
more than 2^30 bytes should be processed without rekeying, so we
enforce that limit here. FYI, this is equal to 1GB of data transferred.
*/
#define ARC4_MAX_BYTES 0x40000000
/******************************************************************************/
/*
SSL_RSA_WITH_RC4_* cipher callbacks
*/
void matrixArc4Init(sslCipherContext_t *ctx, unsigned char *key, int32 keylen)
{
unsigned char index1, index2, tmp, *state;
short counter;
ctx->arc4.byteCount = 0;
state = &ctx->arc4.state[0];
for (counter = 0; counter < 256; counter++) {
matrixssl-1-8-6-open/src/matrixInternal.h view on Meta::CPAN
psPool_t *pool; /* SSL session pool */
psPool_t *hsPool; /* Full session handshake pool */
unsigned char sessionIdLen;
char sessionId[SSL_MAX_SESSION_ID_SIZE];
/* Pointer to the negotiated cipher information */
sslCipherSpec_t *cipher;
/* Symmetric cipher callbacks
We duplicate these here from 'cipher' because we need to set the
various callbacks at different times in the handshake protocol
Also, there are 64 bit alignment issues in using the function pointers
within 'cipher' directly
*/
int32 (*encrypt)(sslCipherContext_t *ctx, unsigned char *in,
unsigned char *out, int32 len);
int32 (*decrypt)(sslCipherContext_t *ctx, unsigned char *in,
unsigned char *out, int32 len);
/* Public key ciphers */
int32 (*encryptPub)(psPool_t *pool, sslRsaKey_t *key,
unsigned char *in, int32 inlen,
matrixssl-1-8-6-open/src/sslDecode.c view on Meta::CPAN
} else {
ssl->err = SSL_ALERT_ILLEGAL_PARAMETER;
matrixStrDebugMsg("Invalid value for CipherSpec\n", NULL);
goto encodeResponse;
}
/*
If we're expecting finished, then this is the right place to get
this record. It is really part of the handshake but it has its
own record type.
Activate the read cipher callbacks, so we will decrypt incoming
data from now on.
*/
if (ssl->hsState == SSL_HS_FINISHED) {
sslActivateReadCipher(ssl);
} else {
ssl->err = SSL_ALERT_UNEXPECTED_MESSAGE;
matrixIntDebugMsg("Invalid CipherSpec order: %d\n", ssl->hsState);
goto encodeResponse;
}
in->start = c;
( run in 1.595 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )