Commit Graph

98 Commits

Author SHA1 Message Date
terrafrost
e32531001b ASN1: limit OID length 2024-02-24 13:07:01 -06:00
terrafrost
585e0e44f4 ASN1: fix string conversion code for 32-bit PHP installs 2023-08-24 20:20:11 -05:00
Côme Chilliet
74ee25bf8a Fix PHP 8.2 dynamic property warning 2022-11-27 21:37:05 -06:00
terrafrost
973bb072a0 ASN1: return false when not enough bytes are available 2021-06-24 21:36:03 -05:00
danieljankowski
b07738814e ASN1: fix timezone issue when non-utc time is given 2021-05-09 07:08:20 -05:00
terrafrost
e02c8452d4 ASN1: fail when encountering unsupported tags 2021-04-03 15:54:27 -05:00
terrafrost
8b8cbecb9b ASN1: make sure constructed bit is what it ought to be 2021-04-03 13:15:58 -05:00
terrafrost
a589442a78 ASN1: uncomment out extra validation code 2021-04-03 11:07:25 -05:00
terrafrost
95f597cfb3 ASN1: tweaks to tag decoding 2021-04-02 13:46:14 -05:00
terrafrost
b90c33200e ASN1: don't allow last octet in OID to have MSB set 2021-04-02 11:00:45 -05:00
William Desportes
2ae683479a
Fix phpdoc errors 2020-09-09 09:43:26 +02:00
terrafrost
fc0832ae99 ASN1: fix for malformed ASN1 strings 2020-03-02 10:18:30 -06:00
terrafrost
e473078703 ASN1: fix PHP 7.4 deprecation 2019-08-03 07:27:26 -05:00
terrafrost
511f55de3d X509: fix issue with explicit time tags whose maps expect implicit 2019-08-02 22:00:33 -05:00
terrafrost
70c0a0ddf4 ASN1: correctly handle long tags 2019-05-26 03:18:06 -05:00
terrafrost
e793461543 ASN1: revamp how OIDs are handled 2019-05-01 09:17:53 -05:00
Michiel Brandenburg
b4e66d343e Fixes #1296 parsing invalid certificate 2018-09-17 00:25:55 -05:00
terrafrost
6dc7b3e6b9 ASN1: class is never set as key in _decode_ber 2018-04-14 23:39:05 -05:00
terrafrost
09c17b1a31 ASN1 / X509: update to use DateTime instead of unix time 2017-08-24 12:48:15 -05:00
Moritz Fain
7fd1eefd66 Fixed ASN.1 UTCTime parsing 2017-04-09 10:15:40 -05:00
terrafrost
845135f887 add PHP5-style constructors along side PHP4-style ones 2016-09-10 10:41:05 -07:00
terrafrost
5c2ffd2544 ASN1: fix infinite loop during ASN1 decode process 2016-08-28 10:43:33 -05:00
terrafrost
dc7f7e4d85 ASN1: fix PHP Warning on PHP 7.1 2016-07-23 11:01:43 -05:00
terrafrost
d525aa66f2 ASN1: adjust ordering of SET OF values 2016-07-19 23:48:23 -05:00
John Sterling
a1e16797ca Improve performance of File\ASN1->_decode_ber() for large data
This removes the use of _string_shift() which copies the (potentially large)
latter part of the input data repeatedly, in favor of maintaining a position var
and using string indexing or substr() to only copy the (relatively small)
current data as it is parsed.
2016-06-26 19:39:44 -05:00
terrafrost
37535744b2 small tweaks 2015-11-21 22:55:20 -05:00
terrafrost
2048a49aac use self:: in phpdoc comments to reduce merge conflicts 2015-10-11 12:22:07 -05:00
Graham Campbell
cd0e10cf9d Fixed lots of phpdoc typos 2015-09-02 00:37:54 +01:00
Graham Campbell
5890f3da98 Fixed invalid param phpdoc 2015-09-02 00:22:30 +01:00
Andreas Fischer
2013a31ecd Use phpcbf to fix PHP code to ruleset. 2015-07-17 12:57:41 +02:00
terrafrost
46a3c0fbbb X509: set parameter field to null for RSA keys 2015-06-28 11:32:42 -05: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
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
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
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
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