Git Product home page Git Product logo

Comments (6)

FiloSottile avatar FiloSottile commented on August 18, 2024

Yeah, I realized line wrapping should not be defined in encode at all, but in the ssh-rsa definition, since it's the only multiline one.

from age.

FiloSottile avatar FiloSottile commented on August 18, 2024

As a start, I moved the wrapping part to the ssh-rsa block, which should be a no-op.

from age.

str4d avatar str4d commented on August 18, 2024

Based on my current understanding of the format, I suggest something like the following:

The text header has the following format:

VERSION_STRING\n
RECIPIENT_LINE_1\n
[...]
RECIPIENT_LINE_N\n
--- MAC\n

All whitespace separators in the header are either a single space character or a single newline (\n) character.

Recipient lines within the header have the following format:

-> TYPE_NAME ARG_1 ARG_2 [...] ARG_J\nBODY

where BODY may have internal newline characters, but does not end in a newline character.

from age.

str4d avatar str4d commented on August 18, 2024

This issue needs to be resolved in order to clear up the definition of what a "recipient line" is, which constraints how implementations ignore unknown recipient types, and how future recipient lines are implemented.

from age.

str4d avatar str4d commented on August 18, 2024

In str4d/rage#52 I am parsing unknown recipient lines using the above format, with the additional constraints that BODY is only Base64-encoded data, and ARG_N may be either Base64-encoded data or a decimal integer.

from age.

FiloSottile avatar FiloSottile commented on August 18, 2024

This is now fixed in the spec, I will make available some test cases of valid weird age files with arbitrary recipients or unknown versions.

The first line of the header is age-encryption.org/ followed by an arbitrary version string. Here and below, an arbitrary string is a sequence of ASCII characters with values 33 to 126. We describe version v1, other versions can change anything after the first line.

The rest of the header is a sequence of one or more recipient stanzas. Each recipient stanza starts with a line beginning with -> and its type name, followed by zero or more SP-separated arguments. The type name and the arguments are arbitrary strings. Unknown recipient types are ignored. The rest of the recipient stanza is a body of canonical base64 from RFC 4648 without padding wrapped at exactly 64 columns.

from age.

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.