Esempio n. 1
0
        protected override void PreRun(TestContext ctx)
        {
            base.PreRun(ctx);

            store = BtlsProvider.CreateNativeStore();
            if (Parameters.AddTrustedRoots)
            {
                store.AddTrustedRoots();
            }
            AddTrustedRoots(ctx);

            chain = BtlsProvider.CreateNativeChain();
            SetupChain(ctx);

            storeCtx = BtlsProvider.CreateNativeStoreCtx();
            storeCtx.Initialize(store, chain);

            verifyParam = SetupVerifyParameters(ctx);

            if (Parameters.CheckTime != null)
            {
                verifyParam.SetTime(Parameters.CheckTime.Value);
            }
            if (Parameters.Host != null)
            {
                verifyParam.SetHost(Parameters.Host);
            }

            if (verifyParam != null)
            {
                storeCtx.SetVerifyParam(verifyParam);
            }
        }
Esempio n. 2
0
 public Task Initialize(TestContext ctx, CancellationToken cancellationToken)
 {
     return(Task.Run(() => {
         store = BtlsProvider.CreateNativeStore();
         if (loadTrustedRoots)
         {
             store.AddTrustedRoots();
         }
     }));
 }
Esempio n. 3
0
 public Task Destroy(TestContext ctx, CancellationToken cancellationToken)
 {
     return(Task.Run(() => {
         if (store != null)
         {
             store.Dispose();
             store = null;
         }
     }));
 }
Esempio n. 4
0
 protected override void PostRun(TestContext ctx)
 {
     if (verifyParam != null)
     {
         verifyParam.Dispose();
         verifyParam = null;
     }
     if (storeCtx != null)
     {
         storeCtx.Dispose();
         storeCtx = null;
     }
     if (chain != null)
     {
         chain.Dispose();
         chain = null;
     }
     if (store != null)
     {
         store.Dispose();
         store = null;
     }
     base.PostRun(ctx);
 }