1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-11-27 04:34:45 +01:00
Commit Graph

178 Commits

Author SHA1 Message Date
Andreas Fischer
2013a31ecd Use phpcbf to fix PHP code to ruleset. 2015-07-17 12:57:41 +02:00
Andreas Fischer
6c76df46d4 Ignore coding guidelines in ANSI switch block. 2015-07-17 12:57:05 +02:00
terrafrost
0d3a117608 X509: add a comment to explain the bitmask 2015-07-17 00:45:20 -05:00
terrafrost
693804e62a X509: move where Crypt/Random loading is done 2015-07-16 11:50:22 -05:00
terrafrost
374f8db2e3 X509: use a random serial number 2015-07-16 11:31:20 -05:00
terrafrost
77c757d095 X509: set one more parameter to null 2015-06-29 22:10:18 -05:00
terrafrost
6c2798be90 X509: set another parameters field to null 2015-06-29 21:53:27 -05:00
terrafrost
46a3c0fbbb X509: set parameter field to null for RSA keys 2015-06-28 11:32:42 -05:00
Andreas Fischer
a79b4ac6ad Merge pull request #699 from terrafrost/asn1-fix-1.0
ASN1 parsing fix for issue mainly effecting CSR's for 1.0 branch

* terrafrost/asn1-fix-1.0:
  ASN1: handle malformed input better
  Tests/X509/CSR: add unit test for ASN1 changes
  ASN1: constructed context-specific tags can have x sub elements
2015-06-16 16:30:35 +02:00
terrafrost
11000a93b9 ASN1: handle malformed input better 2015-06-07 09:59:13 -05:00
terrafrost
d3a5398fe4 ASN1: constructed context-specific tags can have x sub elements
previously it only worked for when there was one sub element.
2015-06-03 23:48:43 -05:00
terrafrost
48191bdeec ANSI: fix typo 2015-05-23 17:39:17 -05:00
terrafrost
2bb70a1c22 ANSI: rendering improvements 2015-05-23 16:51:57 -05:00
terrafrost
cc0420b36b ANSI: improve vt100 terminal emulation
store each coordinate's attributes independently and add support
for a few more escape codes
2015-05-23 11:55:03 -05:00
Andreas Fischer
5d2590feb0 Replace ; with : in case statement. 2015-05-03 13:18:23 +02:00
terrafrost
7ac2470c98 Merge branch '1.0' of https://github.com/phpseclib/phpseclib into x509-custom-extensions 2015-03-09 01:38:33 -05:00
terrafrost
e686c095b6 X509: always base64-encode extensions for which _getMapping returns a bool 2015-03-01 12:05:49 -06:00
terrafrost
7e2dd90140 X509: make it so you can use File_ASN1_Element for custom X.509 extensions 2015-03-01 11:57:36 -06:00
terrafrost
84325d415e ASN1: empty constructed context-specific tags error'd out
eg. an attributes field in a CSR that's blank
2015-01-10 23:58:50 -06:00
Andreas Fischer
0efae5a91e Change copyright years from roman numeral to decimal numbers. 2014-12-10 00:04:08 +01:00
terrafrost
a2f4a2cbba ASN1: add unit test for non-constructed context-specific change 2014-09-22 23:03:06 -05:00
terrafrost
c6ad2b69ba ASN1: fix issue with non-constructed context-specific tags 2014-09-22 01:01:34 -05:00
terrafrost
3bb123c3d5 ASN1: CS adjustment (rm whitespace at eol) 2014-08-30 19:44:12 -05:00
terrafrost
e258e001fa ASN1: rewrite _decode_der
this rewrite makes phpseclib better able to handle indef lengths,
which had previously been untested.
2014-08-25 10:12:56 -05:00
terrafrost
83301097ea RSA: rename PUBLIC_FORMAT_PKCS1_RAW -> PUBLIC_FORMAT_PKCS8
also make CRYPT_RSA_PUBLIC_FORMAT_PKCS8 the default format
2014-06-13 13:11:59 -05:00
terrafrost
72a0913d39 RSA: slight adjustment to CRYPT_RSA_PUBLIC_FORMAT_PKCS1_RAW format
CRYPT_RSA_PUBLIC_FORMAT_PKCS1_RAW and CRYPT_RSA_PUBLIC_FORMAT_PKCS1
produce two very similar looking keys but they are not the same.
As dissection OpenSSL's asn1parse would reveal CRYPT_RSA_PUBLIC_FORMAT_PKCS1
has the fact that it is an RSA key embedded within it whereas
CRYPT_RSA_PUBLIC_FORMAT_PKCS1_RAW does not. phpseclib now resolves
this ambiguity in the same way that OpenSSH's ssh-keygen does.

Despite this change CRYPT_RSA_PUBLIC_FORMAT_PKCS1_RAW is still incompatible
with OpenSSL's rsautl (CRYPT_RSA_PUBLIC_FORMAT_PKCS1 is compatible). I guess
this incompatibility isn't just due to the headers but is also due to the
overall structure of the format.
2014-06-10 22:16:59 -05:00
terrafrost
b1ad911d20 X509: CS adjustments 2014-06-05 08:33:27 -05:00
terrafrost
aabc5cf822 X509: PHP4 compat changes 2014-06-05 08:10:52 -05:00
terrafrost
dce03bb003 X509: add signSPKAC() and saveSPKAC() methods 2014-06-03 23:44:09 -05:00
terrafrost
1b9c599476 ASN1: let strings in as well 2014-05-05 17:38:33 -05:00
terrafrost
7a9ea673ca ASN1: make File_ASN1 accept int primitives and not just Math_BigInteger objects when an integer is expected
The code to convert the regular integer type into the appropriate format could all just be in-line'd when an integer primitive is used but this approach is easier to read.
2014-05-05 16:39:35 -05:00
terrafrost
10be403aff ASN1: CS update 2014-04-12 12:01:04 -05:00
terrafrost
61cd5e4f5a ASN1: make developing new ASN.1 scripts a little easier 2014-04-10 13:49:28 -05:00
terrafrost
c8bf68ac02 ASN1: make it so bit string's can have an optional minimum size 2014-04-05 18:07:35 -05:00
terrafrost
a478b74860 ASN1: explicit application tags didn't work (although implicit ones did) 2014-03-30 01:11:47 -05:00
terrafrost
dfa583b9ea X509: Array -> array (CS consistency) 2014-03-29 15:26:50 -05:00
Michael Braun
457f8fbb99 fix certificate date encoding
RFC 3280 requires in section
 - 4.1.2.5 Validity
 - 5.1.2.4 This Update
 - 5.1.2.5 Next Update
 - 5.1.2.6 Revoked Certificates
that dates are to be encoded as utcTime iff they are before 2050 and
as generalTime otherwise.

Currently, phpseclib does not respect this by always choosing generalTime.
Further, the format used interally to represent dates only keeps two digits,
so dates in 2050 and later cannot be represented in this format.

This patch fixes this by
 1. changing the interal format to be capable of unambiguously representing
    dates in 2050 or later (i.e. use four digits to represent the year),
 2. choosing between utcTime and generalTime accordingly.

Without this patch, openssl_x509_parse complains:
 Warning: openssl_x509_parse(): illegal ASN1 data type for timestamp
2014-03-28 15:02:50 +01:00
Andreas Fischer
fb1296bbec Drop meaningless, outdated, inconsistent version tags in doc blocks.
find phpseclib -type f -name "*.php" -exec sed -i '/@version/d' {} \;
2014-03-11 15:58:33 +01:00
Veres Lajos
930a3fb4d2 typofixes - https://github.com/vlajos/misspell_fixer 2014-03-05 23:41:20 +00:00
Graham Campbell
1c2796e3eb Cleaned up whitespace 2014-01-18 17:29:25 +00:00
terrafrost
d2c4ccfc28 Merge branch 'master' of https://github.com/phpseclib/phpseclib 2013-12-27 10:24:47 -06:00
terrafrost
b23a693ae5 RSA: update comments for _extractBER 2013-12-26 01:46:58 -06:00
Andreas Fischer
8bb80b3df0 CS: Add useful whitespace CodeSniffer rules. 2013-12-26 00:33:08 +01:00
Andreas Fischer
f0f029b2c1 CS: Fix "PEAR.Commenting.ClassComment.WrongTagOrder" sniff. 2013-12-11 18:33:18 +01:00
Andreas Fischer
3db1fbb072 CS: Fix "PEAR.Commenting.FileComment.TagIndent" sniff. 2013-12-10 20:10:37 +01:00
Andreas Fischer
cee0f3343b CS: Fix "PEAR.Formatting.MultiLineAssignment.EqualSignLine" sniff. 2013-12-07 20:47:30 +01:00
Andreas Fischer
6d1fb9f7db CS: Fix "PEAR.Files.IncludingFile.UseIncludeOnce" sniff. 2013-12-06 01:03:34 +01:00
Andreas Fischer
bc6ff96292 Fix "PEAR.Files.IncludingFile.BracketsNotRequired" sniff. 2013-12-05 23:17:40 +01:00
Andreas Fischer
161bb7d362 CS: Fix PEAR.ControlStructures.ControlSignature sniff. 2013-12-03 21:04:13 +01:00
Andreas Fischer
9ca5f83dec CS: Fix Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma sniff. 2013-12-03 20:52:08 +01:00