Fossil SCM
Remove ssh signature from manifests, when needed.
Commit
d346d6d20313e112eef0dbcf126c9d94f13057695031053a79a0a7f3cd121d00
Parent
bbed5d8d7e192fa…
1 file changed
+7
-3
+7
-3
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -318,18 +318,22 @@ | ||
| 318 | 318 | */ |
| 319 | 319 | static void remove_pgp_signature(const char **pz, int *pn){ |
| 320 | 320 | const char *z = *pz; |
| 321 | 321 | int n = *pn; |
| 322 | 322 | int i; |
| 323 | - if( strncmp(z, "-----BEGIN PGP SIGNED MESSAGE-----", 34)!=0 ) return; | |
| 324 | - for(i=34; i<n && !after_blank_line(z+i); i++){} | |
| 323 | + if( strncmp(z, "-----BEGIN PGP SIGNED MESSAGE-----", 34)==0 ) i = 34; | |
| 324 | + else if( strncmp(z, "-----BEGIN SSH SIGNED MESSAGE-----", 34)==0 ) i = 34; | |
| 325 | + else return; | |
| 326 | + for(; i<n && !after_blank_line(z+i); i++){} | |
| 325 | 327 | if( i>=n ) return; |
| 326 | 328 | z += i; |
| 327 | 329 | n -= i; |
| 328 | 330 | *pz = z; |
| 329 | 331 | for(i=n-1; i>=0; i--){ |
| 330 | - if( z[i]=='\n' && strncmp(&z[i],"\n-----BEGIN PGP SIGNATURE-", 25)==0 ){ | |
| 332 | + if( z[i]=='\n' && | |
| 333 | + (strncmp(&z[i],"\n-----BEGIN PGP SIGNATURE-----", 29)==0 | |
| 334 | + || strncmp(&z[i],"\n-----BEGIN SSH SIGNATURE-----", 29)==0 )){ | |
| 331 | 335 | n = i+1; |
| 332 | 336 | break; |
| 333 | 337 | } |
| 334 | 338 | } |
| 335 | 339 | *pn = n; |
| 336 | 340 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -318,18 +318,22 @@ | |
| 318 | */ |
| 319 | static void remove_pgp_signature(const char **pz, int *pn){ |
| 320 | const char *z = *pz; |
| 321 | int n = *pn; |
| 322 | int i; |
| 323 | if( strncmp(z, "-----BEGIN PGP SIGNED MESSAGE-----", 34)!=0 ) return; |
| 324 | for(i=34; i<n && !after_blank_line(z+i); i++){} |
| 325 | if( i>=n ) return; |
| 326 | z += i; |
| 327 | n -= i; |
| 328 | *pz = z; |
| 329 | for(i=n-1; i>=0; i--){ |
| 330 | if( z[i]=='\n' && strncmp(&z[i],"\n-----BEGIN PGP SIGNATURE-", 25)==0 ){ |
| 331 | n = i+1; |
| 332 | break; |
| 333 | } |
| 334 | } |
| 335 | *pn = n; |
| 336 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -318,18 +318,22 @@ | |
| 318 | */ |
| 319 | static void remove_pgp_signature(const char **pz, int *pn){ |
| 320 | const char *z = *pz; |
| 321 | int n = *pn; |
| 322 | int i; |
| 323 | if( strncmp(z, "-----BEGIN PGP SIGNED MESSAGE-----", 34)==0 ) i = 34; |
| 324 | else if( strncmp(z, "-----BEGIN SSH SIGNED MESSAGE-----", 34)==0 ) i = 34; |
| 325 | else return; |
| 326 | for(; i<n && !after_blank_line(z+i); i++){} |
| 327 | if( i>=n ) return; |
| 328 | z += i; |
| 329 | n -= i; |
| 330 | *pz = z; |
| 331 | for(i=n-1; i>=0; i--){ |
| 332 | if( z[i]=='\n' && |
| 333 | (strncmp(&z[i],"\n-----BEGIN PGP SIGNATURE-----", 29)==0 |
| 334 | || strncmp(&z[i],"\n-----BEGIN SSH SIGNATURE-----", 29)==0 )){ |
| 335 | n = i+1; |
| 336 | break; |
| 337 | } |
| 338 | } |
| 339 | *pn = n; |
| 340 |