Coder Social home page Coder Social logo

Comments (3)

biifer avatar biifer commented on August 30, 2024

Looking through the event log I find this error: (Translated from Swedish)

Application programs: Pass4Win.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Details: LibGit2Sharp.RepositoryNotFoundException Stack: at LibGit2Sharp.Repository..ctor (System.String, LibGit2Sharp.RepositoryOptions) at Pass4Win.frmMain..ctor () at Pass4Win.Program.Main ()

from pass4win.

biifer avatar biifer commented on August 30, 2024

It's something to do with the CredentialProvider. If I edit the source myself and set hard coded values it works correctly. I'm no C# developer but I'll try to figure out what's going on here...

                fetchOptions.CredentialsProvider = (_url, _user, _cred) => new UsernamePasswordCredentials
                {
                    Username = "ivan",
                    Password = "supersecretpassword"
                };

from pass4win.

mbos avatar mbos commented on August 30, 2024

Good work.
The only thing that could cause this are the EncryptConfig() and DecryptConfig() functions if you debug it you could probably see how your password get's mangled. I suspect it has to do with using the unicode encoding:

        /// Encrypt the git password
        /// </summary>
        /// <param name="password"></param>
        /// <param name="salt"></param>
        /// <returns></returns>
        static public string EncryptConfig(string password, string salt)
        {
            byte[] passwordBytes = Encoding.Unicode.GetBytes(password);
            byte[] saltBytes = Encoding.Unicode.GetBytes(salt);
            byte[] cipherBytes = ProtectedData.Protect(passwordBytes, saltBytes, DataProtectionScope.CurrentUser);

            return Convert.ToBase64String(cipherBytes);
        }

        /// <summary>
        /// decrypts the git password
        /// </summary>
        /// <param name="cipher"></param>
        /// <param name="salt"></param>
        /// <returns></returns>
        static public string DecryptConfig(string cipher, string salt)
        {
            byte[] cipherBytes = Convert.FromBase64String(cipher);
            byte[] saltBytes = Encoding.Unicode.GetBytes(salt);
            byte[] passwordBytes = ProtectedData.Unprotect(cipherBytes, saltBytes, DataProtectionScope.CurrentUser);

            return Encoding.Unicode.GetString(passwordBytes);

So basically making here unicode in utf8 might work....
Let me know if this is the case.

from pass4win.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.