Lines Matching refs:ctx

50 -static int 	xmlSecNssBlockCipherCtxInit		(xmlSecNssBlockCipherCtxPtr ctx,
56 -static int xmlSecNssBlockCipherCtxUpdate (xmlSecNssBlockCipherCtxPtr ctx,
62 -static int xmlSecNssBlockCipherCtxFinal (xmlSecNssBlockCipherCtxPtr ctx,
331 xmlSecNssBlockCipherCtxInit(xmlSecNssBlockCipherCtxPtr ctx,
346 xmlSecAssert2(ctx != NULL, -1);
347 - xmlSecAssert2(ctx->cipher != 0, -1);
348 + xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ;
349 + xmlSecAssert2( ctx->symkey != NULL , -1 ) ;
350 xmlSecAssert2(ctx->cipherCtx == NULL, -1);
351 - xmlSecAssert2(ctx->keyInitialized != 0, -1);
352 - xmlSecAssert2(ctx->ctxInitialized == 0, -1);
353 + xmlSecAssert2( ctx->keyId != NULL , -1 ) ;
358 ivLen = PK11_GetIVLength(ctx->cipher);
360 - xmlSecAssert2((xmlSecSize)ivLen <= sizeof(ctx->iv), -1);
381 - rv = PK11_GenerateRandom(ctx->iv, ivLen);
404 - ret = xmlSecBufferAppend(out, ctx->iv, ivLen);
427 - memcpy(ctx->iv, xmlSecBufferGetData(in), ivLen);
447 - keyItem.data = ctx->key;
448 - keyItem.len = ctx->keySize;
450 - ivItem.data = ctx->iv;
451 - ivItem.len = ctx->ivSize;
453 - slot = PK11_GetBestSlot(ctx->cipher, NULL);
466 - symKey = PK11_ImportSymKey(slot, ctx->cipher, PK11_OriginDerive,
471 + if( ( secParam = PK11_ParamFromIV( ctx->cipher , &ivItem ) ) == NULL ) {
483 ctx->cipherCtx = PK11_CreateContextBySymKey(ctx->cipher,
486 + ctx->symkey, secParam);
487 if(ctx->cipherCtx == NULL) {
501 - ctx->ctxInitialized = 1;
513 xmlSecNssBlockCipherCtxUpdate(xmlSecNssBlockCipherCtxPtr ctx,
526 xmlSecAssert2(ctx != NULL, -1);
527 - xmlSecAssert2(ctx->cipher != 0, -1);
528 + xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ;
529 + xmlSecAssert2( ctx->symkey != NULL , -1 ) ;
530 xmlSecAssert2(ctx->cipherCtx != NULL, -1);
531 - xmlSecAssert2(ctx->ctxInitialized != 0, -1);
532 + xmlSecAssert2( ctx->keyId != NULL , -1 ) ;
537 - blockLen = PK11_GetBlockSize(ctx->cipher, NULL);
539 + if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) {
585 - rv = PK11_CipherOp(ctx->cipherCtx, outBuf, &outLen, inSize + blockLen,
588 + if(PK11_CipherOp( ctx->cipherCtx , outBuf , &outLen , inSize + blockSize , xmlSecBufferGetData…
637 xmlSecAssert2(ctx != NULL, -1);
638 - xmlSecAssert2(ctx->cipher != 0, -1);
639 + xmlSecAssert2( ctx->cipher != CKM_INVALID_MECHANISM , -1 ) ;
640 + xmlSecAssert2( ctx->symkey != NULL , -1 ) ;
641 xmlSecAssert2(ctx->cipherCtx != NULL, -1);
642 - xmlSecAssert2(ctx->ctxInitialized != 0, -1);
643 + xmlSecAssert2( ctx->keyId != NULL , -1 ) ;
648 - blockLen = PK11_GetBlockSize(ctx->cipher, NULL);
650 + if( ( blockSize = PK11_GetBlockSize( ctx->cipher , NULL ) ) < 0 ) {
732 - rv = PK11_CipherOp(ctx->cipherCtx, outBuf, &outLen, 2 * blockLen,
735 + if( PK11_CipherOp( ctx->cipherCtx , outBuf , &outLen , inSize + blockSize , xmlSecBufferGetDat…
839 - xmlSecNssBlockCipherCtxPtr ctx;
844 - ctx = xmlSecNssBlockCipherGetCtx(transform);
845 - xmlSecAssert2(ctx != NULL, -1);
847 - memset(ctx, 0, sizeof(xmlSecNssBlockCipherCtx));
851 - ctx->cipher = CKM_DES3_CBC;
852 - ctx->keyId = xmlSecNssKeyDataDesId;
853 - ctx->keySize = 24;
859 - ctx->cipher = CKM_AES_CBC;
860 - ctx->keyId = xmlSecNssKeyDataAesId;
861 - ctx->keySize = 16;
863 - ctx->cipher = CKM_AES_CBC;
864 - ctx->keyId = xmlSecNssKeyDataAesId;
865 - ctx->keySize = 24;
867 - ctx->cipher = CKM_AES_CBC;
868 - ctx->keyId = xmlSecNssKeyDataAesId;
869 - ctx->keySize = 32;
889 - xmlSecNssBlockCipherCtxPtr ctx;
894 - ctx = xmlSecNssBlockCipherGetCtx(transform);
895 - xmlSecAssert(ctx != NULL);
897 - if(ctx->cipherCtx != NULL) {
898 - PK11_DestroyContext(ctx->cipherCtx, PR_TRUE);
901 - memset(ctx, 0, sizeof(xmlSecNssBlockCipherCtx));
906 - xmlSecNssBlockCipherCtxPtr ctx;
913 - ctx = xmlSecNssBlockCipherGetCtx(transform);
914 - xmlSecAssert2(ctx != NULL, -1);
915 - xmlSecAssert2(ctx->keyId != NULL, -1);
917 + if( PK11_DigestFinal( ctx->cipherCtx , outBuf , &outLen , blockSize ) != SECSuccess ) {
945 +/* PK11_Finalize( ctx->cipherCtx ) ;*/
946 + PK11_DestroyContext(ctx->cipherCtx, PR_TRUE);
947 + ctx->cipherCtx = NULL ;
949 - keyReq->keyId = ctx->keyId;
956 - keyReq->keyBitsSize = 8 * ctx->keySize;
962 - xmlSecNssBlockCipherCtxPtr ctx;
991 - ctx = xmlSecNssBlockCipherGetCtx(transform);
992 - xmlSecAssert2(ctx != NULL, -1);
993 - xmlSecAssert2(ctx->cipher != 0, -1);
994 - xmlSecAssert2(ctx->keyInitialized == 0, -1);
995 - xmlSecAssert2(ctx->keyId != NULL, -1);
996 - xmlSecAssert2(xmlSecKeyCheckId(key, ctx->keyId), -1);
998 - xmlSecAssert2(ctx->keySize > 0, -1);
999 - xmlSecAssert2(ctx->keySize <= sizeof(ctx->key), -1);
1006 - if(xmlSecBufferGetSize(buffer) < ctx->keySize) {
1014 - xmlSecBufferGetSize(buffer), ctx->keySize);
1022 - memcpy(ctx->key, xmlSecBufferGetData(buffer), ctx->keySize);
1024 - ctx->keyInitialized = 1;
1030 - xmlSecNssBlockCipherCtxPtr ctx;
1042 - ctx = xmlSecNssBlockCipherGetCtx(transform);
1043 - xmlSecAssert2(ctx != NULL, -1);
1055 - if(ctx->ctxInitialized == 0) {
1056 - ret = xmlSecNssBlockCipherCtxInit(ctx, in, out,
1072 - if((ctx->ctxInitialized == 0) && (last != 0)) {
1083 - if(ctx->ctxInitialized != 0) {
1084 - ret = xmlSecNssBlockCipherCtxUpdate(ctx, in, out,
1102 - ret = xmlSecNssBlockCipherCtxFinal(ctx, in, out,