mirror of
https://codeberg.org/scip/pcp.git
synced 2025-12-17 20:00:58 +01:00
changed z85 header and comment syntax and parser
This commit is contained in:
@@ -58,21 +58,15 @@ typedef unsigned short dbyte; /* Double byte = 16 bits */
|
||||
typedef unsigned int qbyte; /* Quad byte = 32 bits */
|
||||
|
||||
/* key stuff, deprecated. */
|
||||
#define PCP_KEY_HEADER "----- BEGIN PCP SECRET KEY -----"
|
||||
#define PCP_KEY_FOOTER "------ END PCP SECRET KEY ------"
|
||||
#define PCP_ENFILE_HEADER "~~~~~ BEGIN PCP ENCRYPTED FILE ~~~~~"
|
||||
#define PCP_ENFILE_FOOTER "~~~~~ END PCP ENCRYPTED FILE ~~~~~"
|
||||
|
||||
#define PCP_PUBKEY_HEADER "----- BEGIN PCP PUBLIC KEY -----"
|
||||
#define PCP_PUBKEY_FOOTER "------ END PCP PUBLICKEY ------"
|
||||
#define PCP_ZFILE_HEADER "~~~~~ BEGIN Z85 ENCODED FILE ~~~~~"
|
||||
#define PCP_ZFILE_FOOTER "~~~~~ END Z85 ENCODED FILE ~~~~~"
|
||||
|
||||
#define PCP_ENFILE_HEADER "----- BEGIN PCP ENCRYPTED FILE -----"
|
||||
#define PCP_ENFILE_FOOTER "------ END PCP ENCRYPTED FILE ------"
|
||||
|
||||
#define PCP_ZFILE_HEADER "----- BEGIN Z85 ENCODED FILE -----"
|
||||
#define PCP_ZFILE_FOOTER "------ END Z85 ENCODED FILE ------"
|
||||
|
||||
#define PCP_SIG_HEADER "----- BEGIN ED25519 SIGNED MESSAGE -----"
|
||||
#define PCP_SIG_START "----- BEGIN ED25519 SIGNATURE -----"
|
||||
#define PCP_SIG_END "------ END ED25519 SIGNATURE ------"
|
||||
#define PCP_SIG_HEADER "~~~~~ BEGIN ED25519 SIGNED MESSAGE ~~~~~"
|
||||
#define PCP_SIG_START "~~~~~ BEGIN ED25519 SIGNATURE ~~~~~"
|
||||
#define PCP_SIG_END "~~~~~ END ED25519 SIGNATURE ~~~~~"
|
||||
#define PCP_SIGPREFIX "\nnacl-"
|
||||
|
||||
#define PCP_ME "Pretty Curved Privacy"
|
||||
|
||||
@@ -109,10 +109,10 @@ typedef struct _pcp_ks_bundle_t pcp_ks_bundle_t;
|
||||
#define EXP_SIG_SUB_KEYFLAGS 27
|
||||
|
||||
/* in armored mode, we're using the usual head+foot */
|
||||
#define EXP_PK_HEADER "-----BEGIN ED25519-CURVE29915 PUBLIC KEY-----"
|
||||
#define EXP_PK_FOOTER "------END ED25519-CURVE29915 PUBLIC KEY------"
|
||||
#define EXP_SK_HEADER "-----BEGIN ED25519-CURVE29915 PRIVATE KEY-----"
|
||||
#define EXP_SK_FOOTER "------END ED25519-CURVE29915 PRIVATE KEY------"
|
||||
#define EXP_PK_HEADER "~~~~~BEGIN ED25519-CURVE29915 PUBLIC KEY~~~~~"
|
||||
#define EXP_PK_FOOTER "~~~~~END ED25519-CURVE29915 PUBLIC KEY~~~~~"
|
||||
#define EXP_SK_HEADER "~~~~~BEGIN ED25519-CURVE29915 PRIVATE KEY~~~~~"
|
||||
#define EXP_SK_FOOTER "~~~~~END ED25519-CURVE29915 PRIVATE KEY~~~~~"
|
||||
|
||||
|
||||
/* pubkey export formats */
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "mem.h"
|
||||
#include "util.h"
|
||||
#include "defines.h"
|
||||
|
||||
@@ -131,6 +131,17 @@ char *pcp_readz85string(unsigned char *input, size_t bufsize);
|
||||
*/
|
||||
size_t _buffer_is_binary(unsigned char *buf, size_t len);
|
||||
|
||||
|
||||
/** Determine if a char is a Z85 character
|
||||
|
||||
\param[out] z Buffer object where to put the char if it's z85 and not inside a comment.
|
||||
\param[in] c The char to check.
|
||||
\param[in] is_comment Denotes if we're currently within a comment.
|
||||
|
||||
\return Returns 1 if a comment starts or 0 otherwise.
|
||||
*/
|
||||
uint8_t _parse_zchar(Buffer *z, uint8_t c, uint8_t is_comment);
|
||||
|
||||
#endif /* _HAVE_PCP_Z85_H */
|
||||
|
||||
/**@}*/
|
||||
|
||||
Reference in New Issue
Block a user