Examples of SecHandle


Examples of org.tmatesoft.svn.core.internal.util.jna.ISVNSecurityLibrary.SecHandle

        return JNALibraryLoader.getSecurityLibrary() != null;
    }
   
    public static SVNNTSecurityParameters getSecurityParams(String userName, String password,
            String ntDomain) {
        SecHandle crdHandle = getCredentialsHandle(userName, password, ntDomain);
        if (crdHandle == null) {
            return null;
        }

        SVNNTSecurityParameters secParams = new SVNNTSecurityParameters();
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.util.jna.ISVNSecurityLibrary.SecHandle

        ISVNSecurityLibrary library = JNALibraryLoader.getSecurityLibrary();
        if (library == null) {
            return null;
        }

        SecHandle newContext = null;
        SecHandle pContext = params.myCtxHandle;
        if (pContext == null) {
            newContext = new SecHandle();
            newContext.dwLower = new NativeLong(0);
            newContext.dwUpper = new NativeLong(0);
            newContext.write();
            params.myCtxHandle = newContext;
        } else {
            newContext = pContext;
        }
       
        SecBuffer outSecBuffer = new SecBuffer();
        outSecBuffer.cbBuffer = new NativeLong(512);
        outSecBuffer.BufferType = new NativeLong(ISVNSecurityLibrary.SECBUFFER_TOKEN);
        outSecBuffer.pvBuffer = new Memory(512);
        outSecBuffer.write();
       
        SecBufferDesc outBufferDescription = new SecBufferDesc();
        outBufferDescription.ulVersion = new NativeLong(0);
        outBufferDescription.cBuffers = new NativeLong(1);
        outBufferDescription.pBuffers = outSecBuffer.getPointer();

        outBufferDescription.write();
       
        SecBufferDesc inBufferDescription = null;
        SecBuffer inSecBuffer = null;
        if (lastToken != null) {
            inSecBuffer = new SecBuffer();
            inSecBuffer.cbBuffer = new NativeLong(lastToken.length);
            inSecBuffer.BufferType = new NativeLong(ISVNSecurityLibrary.SECBUFFER_TOKEN);
            inSecBuffer.pvBuffer = new Memory(lastToken.length);
            inSecBuffer.pvBuffer.write(0, lastToken, 0, lastToken.length);
            inSecBuffer.write();
               
            inBufferDescription = new SecBufferDesc();
            inBufferDescription.ulVersion = new NativeLong(0);
            inBufferDescription.cBuffers = new NativeLong(1);
            inBufferDescription.pBuffers = inSecBuffer.getPointer();
            inBufferDescription.write();
        }
       
        Pointer contextAttributes = new Memory(NativeLong.SIZE);
        TimeStamp ltime = new TimeStamp();
        ltime.HighPart = new NativeLong(0);
        ltime.LowPart = new NativeLong(0);
        ltime.write();
       
        int securityStatus = library.InitializeSecurityContextW(params.myCrdHandle.getPointer(),
                pContext != null ? pContext.getPointer() : Pointer.NULL,
                        null,
                        new NativeLong(0),
                        new NativeLong(0),
                        new NativeLong(ISVNSecurityLibrary.SECURITY_NATIVE_DREP),
                        lastToken != null ? inBufferDescription.getPointer() : Pointer.NULL,
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.util.jna.ISVNSecurityLibrary.SecHandle

            }
            authIdentity.Flags = new NativeLong(ISVNSecurityLibrary.SEC_WINNT_AUTH_IDENTITY_UNICODE);
            authIdentity.write();
        }
       
        SecHandle pCred = new SecHandle();
        pCred.dwLower = new NativeLong(0);
        pCred.dwUpper = new NativeLong(0);
        pCred.write();

        ISVNSecurityLibrary.TimeStamp ltime = new ISVNSecurityLibrary.TimeStamp();
        ltime.HighPart = new NativeLong(0);
        ltime.LowPart = new NativeLong(0);
        ltime.write();
       
        int securityStatus = library.AcquireCredentialsHandleW(null, new WString("NTLM"),
                new NativeLong(ISVNSecurityLibrary.SECPKG_CRED_OUTBOUND), Pointer.NULL,
                authIdentity != null ? authIdentity.getPointer() : Pointer.NULL,
                        Pointer.NULL, Pointer.NULL, pCred.getPointer(), ltime.getPointer());
        if (securityStatus == 0) {
            pCred.read();
            return pCred;
        }
        return null;
    }
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.util.jna.ISVNSecurityLibrary.SecHandle

    public static boolean isNativeLibraryAvailable() {
        return JNALibraryLoader.getSecurityLibrary() != null;
    }
   
    public static SVNNTSecurityParameters getSecurityParams(String userName, String password, String ntDomain) {
        SecHandle crdHandle = getCredentialsHandle(userName, password, ntDomain);
        if (crdHandle == null) {
            return null;
        }

        SVNNTSecurityParameters secParams = new SVNNTSecurityParameters();
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.util.jna.ISVNSecurityLibrary.SecHandle

        ISVNSecurityLibrary library = JNALibraryLoader.getSecurityLibrary();
        if (library == null) {
            return null;
        }

        SecHandle newContext = null;
        SecHandle pContext = params.myCtxHandle;
        if (pContext == null) {
            newContext = new SecHandle();
            newContext.dwLower = new NativeLong(0);
            newContext.dwUpper = new NativeLong(0);
            newContext.write();
            params.myCtxHandle = newContext;
        } else {
            newContext = pContext;
        }
       
        SecBuffer outSecBuffer = new SecBuffer();
        outSecBuffer.cbBuffer = new NativeLong(512);
        outSecBuffer.BufferType = new NativeLong(ISVNSecurityLibrary.SECBUFFER_TOKEN);
        outSecBuffer.pvBuffer = new Memory(512);
        outSecBuffer.write();
       
        SecBufferDesc outBufferDescription = new SecBufferDesc();
        outBufferDescription.ulVersion = new NativeLong(0);
        outBufferDescription.cBuffers = new NativeLong(1);
        outBufferDescription.pBuffers = outSecBuffer.getPointer();

        outBufferDescription.write();
       
        SecBufferDesc inBufferDescription = null;
        SecBuffer inSecBuffer = null;
        if (lastToken != null) {
            inSecBuffer = new SecBuffer();
            inSecBuffer.cbBuffer = new NativeLong(lastToken.length);
            inSecBuffer.BufferType = new NativeLong(ISVNSecurityLibrary.SECBUFFER_TOKEN);
            inSecBuffer.pvBuffer = new Memory(lastToken.length);
            inSecBuffer.pvBuffer.write(0, lastToken, 0, lastToken.length);
            inSecBuffer.write();
               
            inBufferDescription = new SecBufferDesc();
            inBufferDescription.ulVersion = new NativeLong(0);
            inBufferDescription.cBuffers = new NativeLong(1);
            inBufferDescription.pBuffers = inSecBuffer.getPointer();
            inBufferDescription.write();
        }
       
        Pointer contextAttributes = new Memory(NativeLong.SIZE);
        TimeStamp ltime = new TimeStamp();
        ltime.HighPart = new NativeLong(0);
        ltime.LowPart = new NativeLong(0);
        ltime.write();
       
        int securityStatus = library.InitializeSecurityContextW(params.myCrdHandle.getPointer(),
                pContext != null ? pContext.getPointer() : Pointer.NULL,
                        null,
                        new NativeLong(0),
                        new NativeLong(0),
                        new NativeLong(ISVNSecurityLibrary.SECURITY_NATIVE_DREP),
                        lastToken != null ? inBufferDescription.getPointer() : Pointer.NULL,
View Full Code Here

Examples of org.tmatesoft.svn.core.internal.util.jna.ISVNSecurityLibrary.SecHandle

            }
            authIdentity.Flags = new NativeLong(ISVNSecurityLibrary.SEC_WINNT_AUTH_IDENTITY_UNICODE);
            authIdentity.write();
        }
       
        SecHandle pCred = new SecHandle();
        pCred.dwLower = new NativeLong(0);
        pCred.dwUpper = new NativeLong(0);
        pCred.write();

        ISVNSecurityLibrary.TimeStamp ltime = new ISVNSecurityLibrary.TimeStamp();
        ltime.HighPart = new NativeLong(0);
        ltime.LowPart = new NativeLong(0);
        ltime.write();
       
        int securityStatus = library.AcquireCredentialsHandleW(null, new WString("NTLM"),
                new NativeLong(ISVNSecurityLibrary.SECPKG_CRED_OUTBOUND), Pointer.NULL,
                authIdentity != null ? authIdentity.getPointer() : Pointer.NULL,
                        Pointer.NULL, Pointer.NULL, pCred.getPointer(), ltime.getPointer());
        if (securityStatus == 0) {
            pCred.read();
            return pCred;
        }
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.