Giter VIP home page Giter VIP logo

Comments (8)

gboudreau avatar gboudreau commented on May 16, 2024 1

We can just look in the file, and if we see PRIVATE KEY----- twice, it should be good.

Most ppl use RSA keys, which contain -----BEGIN RSA PRIVATE KEY----- and the equivalent end tag, but I myself use an ED25519 key, which contains -----BEGIN OPENSSH PRIVATE KEY-----. Looking for just the common suffix should be good enough.

from sequel-ace.

jamesstout avatar jamesstout commented on May 16, 2024 1

I've updated my branch with some better validation: https://github.com/jamesstout/Sequel-Ace/tree/more-permissions

from sequel-ace.

jamesstout avatar jamesstout commented on May 16, 2024

Should be a simple change to this validation:

const char rsaHead[] = "-----BEGIN RSA PRIVATE KEY-----";
const char rsaFoot[] = "-----END RSA PRIVATE KEY-----";
if(FindLinesInFile(file, rsaHead, strlen(rsaHead), rsaFoot, strlen(rsaFoot)))
return YES;

EDIT: No, not as simple as that, SP of course has it's own data/line parsing code....

from sequel-ace.

jamesstout avatar jamesstout commented on May 16, 2024

Most ppl use RSA keys, which contain -----BEGIN RSA PRIVATE KEY----- and the equivalent end tag, but I myself use an ED25519 key, which contains -----BEGIN OPENSSH PRIVATE KEY-----. Looking for just the common suffix should be good enough.

What does your cert file have as first/last lines?

from sequel-ace.

gboudreau avatar gboudreau commented on May 16, 2024
-----BEGIN OPENSSH PRIVATE KEY-----
...
-----END OPENSSH PRIVATE KEY-----

from sequel-ace.

Jason-Morcos avatar Jason-Morcos commented on May 16, 2024

I've updated my branch with some better validation: https://github.com/jamesstout/Sequel-Ace/tree/more-permissions

Looks good to me!
With SecurityScopedBookmarks, do we have to somehow start accessing the specific bookmark when we begin a connection and end it out when we close the connection? How does that work with quitting and reopening the app?

from sequel-ace.

jamesstout avatar jamesstout commented on May 16, 2024

With SecurityScopedBookmarks, do we have to somehow start accessing the specific bookmark when we begin a connection and end it out when we close the connection? How does that work with quitting and reopening the app?

Ah, that's a good point, I've forgotten to relinquish access with stopAccessingSecurityScopedResource. In the export controller, I relinquish access when the export ends. We no longer need access.

For the connection controller, we [currently] copy the key to the sandbox, so could call stopAccessingSecurityScopedResource as soon as the key/cert is validated and copied.

However, there was discussion about no longer copying the keys: #52 (comment), so I'd have to figure out where to relinquish access. Maybe after the connection completes. I haven't looked at the actual connection code to see if it retries, or needs the key to keep alive.

I'll have a look later.

from sequel-ace.

jamesstout avatar jamesstout commented on May 16, 2024

I've put stopAccessingSecurityScopedResource in _documentWillClose and dealloc. Please see the branch mentioned above.

from sequel-ace.

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.