1
0
mirror of https://github.com/danog/tgseclib.git synced 2024-12-03 10:07:47 +01:00
Commit Graph

411 Commits

Author SHA1 Message Date
terrafrost
9b4240c104 Use !empty('0') instead of strlen('0')
Thanks petrich!
2013-01-03 00:21:09 -06:00
terrafrost
aa3da09747 Add limited SPKAC support 2012-12-19 00:21:55 -06:00
terrafrost
e4ccaef7bf Make PEM lines be 64 bytes long instead of 72
Also, add more notes to Crypt_Random's comments
2012-12-18 07:11:24 -06:00
terrafrost
7f5e9f404a Random: expand on the explanations as to how things work 2012-12-17 08:41:47 -06:00
terrafrost
885d7e0f24 SFTP: Make get() work correctly when files are being written to for partial transfers 2012-12-16 02:34:49 -06:00
terrafrost
35832fe2a1 Refactor crypt_random (renaming it to crypt_random_string)
...and update all the calls to it accordingly
2012-12-16 02:20:16 -06:00
terrafrost
a731220785 Fix E_NOTICE in SFTP.php (thanks dlgoodchild!) 2012-12-14 08:45:35 -06:00
terrafrost
65193d9a25 SFTP: Add $offset and $length get() function 2012-12-11 19:54:48 -06:00
terrafrost
7401d148f8 Remove unused lines
The MATH_BIGINTEGER_MODE == MATH_BIGINTEGER_MODE_GMP case is already handled earlier
2012-12-11 18:38:45 -06:00
Patrick Monnerat
18fc6b7712 X509: Fix typo: ';' --> ':' 2012-12-10 12:27:07 +01:00
Patrick Monnerat
06779a92de Merge branch 'master' of https://github.com/phpseclib/phpseclib into pmexts 2012-12-10 12:10:06 +01:00
Patrick Monnerat
f039a6ebc2 RSA: Allow changing openssl configuration file. X509: process HoldInstructionCode.
Also fixes HoldInstruction* OIDs.
2012-12-10 12:07:49 +01:00
terrafrost
27f6012d62 Make it so extension OIDs can be File_ASN1_Elements 2012-12-01 10:52:10 -06:00
terrafrost
d130d2274d Make the save*() functions save in multiple formats
Currently only PEM and DER supported.

Also make fuzzing enhancements
2012-11-30 08:31:16 -06:00
terrafrost
3c6ae4312f The user_error in _handle_error shouldn't be replaced.. 2012-11-29 00:19:09 -06:00
terrafrost
3caaa91160 Replace user_error() with new _handle_error() function
To use exceptions do define('PHPSECLIB_USE_EXCEPTIONS', true).

To have the exceptions thrown by phpseclib be of a certain class define PHPSECLIB_EXCEPTION_CLASS.
2012-11-28 23:33:15 -06:00
terrafrost
862253784d Merge branch 'master' of https://github.com/phpseclib/phpseclib 2012-11-28 08:24:00 -06:00
terrafrost
1f6cc77c11 Merge remote-tracking branch 'origin/noauth' 2012-11-28 08:21:36 -06:00
terrafrost
dbc10491e7 Fix an E_NOTICE (thanks chubbypama!) 2012-11-28 08:17:57 -06:00
terrafrost
ff94576315 Remove unused fields from pack() 2012-11-27 14:38:30 -06:00
terrafrost
8ea452ed31 type in comment
(testing out github.com's edit via web interface)
2012-11-27 10:11:49 -06:00
terrafrost
0b9f743343 Add getChain() function
Also improve loading of raw certs
2012-11-25 23:06:58 -06:00
terrafrost
76cb693d62 CS adjustments, make it so PEM-encoded CRLs can be read (again) and make it so already decoded CSRs and CRLs can be read 2012-11-23 19:04:04 -06:00
terrafrost
346bc5dcc8 Make it so none is a supported authentication method 2012-11-22 14:25:57 -06:00
terrafrost
875cef8bbd Revamp logging 2012-11-22 13:08:30 -06:00
terrafrost
6c33012a4a Suppress further error messages if connection is prematurely disconnected 2012-11-22 12:11:15 -06:00
terrafrost
fbf3ba353e Null pad RSA ciphertext's to be the length of the modulo and improve XML parsing 2012-11-19 23:00:04 -06:00
terrafrost
7e120a0f30 Make validateSignature() behave more intuitively 2012-11-19 21:10:22 -06:00
terrafrost
126c396a51 More CS adjustments 2012-11-18 16:29:15 -06:00
terrafrost
406e7e90e9 CS adjustments 2012-11-18 16:16:11 -06:00
terrafrost
2a1909fd71 Set $this->paddable to true in a few missing places 2012-11-16 02:59:06 -06:00
Patrick Monnerat
8f6cd4f91f Merge branch 'master' of https://github.com/phpseclib/phpseclib into pmexts 2012-11-14 16:35:00 +01:00
Patrick Monnerat
a61d7ba29b X509: *Attribute() functions may now handle single values. 2012-11-14 16:33:32 +01:00
terrafrost
8cf6bb0b1c SSH1: Fix E_NOTICE (thanks dayton967!) 2012-11-14 04:34:33 -06:00
terrafrost
691f4d1e62 Make it so loadCA() doesn't have to be called before loadX509() or loadCRL() 2012-11-13 00:43:45 -06:00
terrafrost
d492d19748 X509: Missing $ 2012-11-13 00:37:54 -06:00
terrafrost
1fd87dcd35 Fix bug in listRevoked() and make it so getSubjectDN() doesn't return issuer DN for CRLs 2012-11-13 00:33:15 -06:00
terrafrost
1abc7e742b X509: CSRs and CRLs didn't have the signatureSubject variable saved properly 2012-11-12 23:51:41 -06:00
terrafrost
661eb8db3f Missing ; 2012-11-12 01:05:24 -06:00
terrafrost
0e0eebf456 CS adjustments, make loadXXX() take in binary data, and make getDN() == getIssuerDN() for CRLs 2012-11-12 00:46:03 -06:00
terrafrost
1ff798da47 Merge branch 'master' of https://github.com/phpseclib/phpseclib 2012-11-09 22:24:23 -06:00
terrafrost
6bc46d42e0 Only save the directory if it was able to be successfully created 2012-11-09 22:22:02 -06:00
Patrick Monnerat
ac8d0172eb Merge branch 'master' of https://github.com/phpseclib/phpseclib into pmexts 2012-11-08 12:51:07 +01:00
Patrick Monnerat
7fbf089e32 X509: Do not use memory-wasting create_function() 2012-11-08 12:45:17 +01:00
Patrick Monnerat
4ad2ffe9d7 Merge branch 'master' of https://github.com/phpseclib/phpseclib into pmexts 2012-11-08 12:23:03 +01:00
terrafrost
9ead66143d Updates to mkdir() (thanks easy-dev!) 2012-11-07 23:35:23 -06:00
Patrick Monnerat
dde23464a1 X509: Fix typo. 2012-11-07 16:29:18 +01:00
Patrick Monnerat
5ef4f9900a X509: Suppress {get|set|remove}CRLExtension() functions: non *CRL* functions are now polymorphic. 2012-11-07 16:23:01 +01:00
Patrick Monnerat
d980a91360 X509: Fix DirectoryString syntax 2012-11-07 16:21:23 +01:00
Patrick Monnerat
9860f020c3 X509: Fix typo. 2012-11-07 15:41:41 +01:00
Patrick Monnerat
9b2a6d68f4 X509: Add CSR attributes handling support and CSR extension requests. 2012-11-07 15:35:10 +01:00
Patrick Monnerat
d9ab2d7f10 ASN1: Improve input SEQUENCE and SET mapping, better syntax error detection. 2012-11-07 15:23:54 +01:00
Patrick Monnerat
bf2107eaa8 X509: Suppress {get|set|remove}CRLExtension() functions: non *CRL* functions are now polymorphic. 2012-11-07 15:18:55 +01:00
Patrick Monnerat
1a0ae1ff76 X509: Fix DirectoryString syntax. 2012-11-07 15:03:58 +01:00
Patrick Monnerat
0afed5b65b X509: adjust comments 2012-11-05 12:08:20 +01:00
Patrick Monnerat
916dcff8a8 ASN1/X509: implement limited string conversion. Add getDN() options.
Warning: converted strings must not be used for matching DNs.
2012-11-02 16:53:32 +01:00
Patrick Monnerat
26b842be5b X509: compute public key identifiers.
Force subject public key identifier when signing a CA.
2012-10-29 18:21:25 +01:00
Patrick Monnerat
64c3b309bd ASN1: little optimization for better performance. 2012-10-25 17:54:02 +02:00
Patrick Monnerat
c1c9c38fe6 X509: Avoid an "undefined" error and define netscape-ca-policy-url OID. 2012-10-24 13:36:18 +02:00
Patrick Monnerat
2d34c291f0 ASN1: _decode_ber should now accept a FILE_ASN1_Element object as source. 2012-10-24 11:42:13 +02:00
Patrick Monnerat
340ee0cd2d ASN1/X509: latch effective type of ANY fields as an additional indexing level. 2012-10-23 13:37:51 +02:00
terrafrost
9e803fe374 Return $this->publicKey if it's available in getPublicKey() function 2012-10-22 00:27:26 -05:00
terrafrost
bdd42c448b Change default date format
This change stems from the fact that date('T') on PHP 4 (and possibly 5.0/5.1/etc) returns "Central Daylight Time" vs PHP 5, which returns "CDT".  "CDT" is parsable by strtotime - "Central Daylight Time" is not.

There will still be some dates that won't properly decode, however, on PHP 4.  Those dates would seem to be due to this (from php.net):

"On systems where time_t is a 32bit signed integer, as most common today, the valid range for year is somewhere between 1901 and 2038. However, before PHP 5.1.0 this range was limited from 1970 to 2038 on some systems (e.g. Windows)."
2012-10-19 07:19:22 -05:00
Patrick Monnerat
4c5163234b ASN1: Fix default value optimization upon encoding.
Also encode SETs as SEQUENCEs since order is not important.
2012-10-18 12:38:43 +02:00
terrafrost
ce250ea546 Rename $keyIdentifier to $currentKeyIdentifier
$KeyIdentifier (upper case) is already defined and although it doesn't cause any problems with $keyIdentifier (lower case) I still think it's poor practice
2012-10-18 00:37:48 -05:00
terrafrost
8758ca8517 Merge pull request #24 from monnerat/crl
Certificate Revocation Lists
2012-10-16 04:34:34 -07:00
terrafrost
eba3fbe13e Suppress Warning messages
Warning messages would appear if recursive deletes or chmods were
attempted.  Also, doing pwd() when . was / would return //.
2012-10-13 19:42:01 -05:00
Patrick Monnerat
2c7c7b9679 X509, ASN1: Fix CS and indent. Remove tabs. 2012-10-12 16:17:34 +02:00
monnerat
ef96f777c3 X509: setSerialNumber(): new optional parameter $base 2012-10-12 03:29:25 +01:00
monnerat
711d44f0e5 X509: implement CRLs. 2012-10-12 03:13:39 +01:00
monnerat
6da490d00a X509: new setExtension() method. 2012-10-12 03:03:21 +01:00
monnerat
bc7a59bc8c X509: factorize some code in prevision of CRL support. 2012-10-12 02:56:23 +01:00
monnerat
73b0d05ddc X509: set-up key identifier upon certificate loading. 2012-10-12 02:42:19 +01:00
monnerat
4f634aaca8 X509: avoid some "undefined" errors. 2012-10-12 02:37:55 +01:00
monnerat
2c8ad5ee72 ASN1: _encode_der(): do not encode optional fields with value set to default. 2012-10-12 01:07:01 +01:00
monnerat
a75de60478 ASN1: asn1map(): fix handling of optional CHOICE and ANY children in SEQUENCE. 2012-10-12 01:04:24 +01:00
monnerat
b05cff1320 ASN1: process input NULL fields. 2012-10-12 01:01:20 +01:00
monnerat
50962f9cd3 ASN1: asn1map(): do not rely on input fields to determine mapping parameters. 2012-10-12 00:58:36 +01:00
monnerat
d9a3dafa0a ASN1: Support enumerated types by processing them as integers. 2012-10-12 00:51:42 +01:00
terrafrost
35d6910bf3 Revisions to _logError() function 2012-10-09 07:27:42 -05:00
terrafrost
827090c562 Update comments 2012-10-09 01:00:47 -05:00
terrafrost
c65f5ba0e5 Add SFTPv2 support
Thanks bitvise for providing an SFTP client that does SFTPv2 and to faceleg for bringing the issue to my attention!
2012-10-09 00:56:50 -05:00
terrafrost
7ba006ccdc Add getSize() function to Crypt_RSA 2012-10-07 18:53:26 -05:00
terrafrost
7d1e714a08 Remove extra white space 2012-10-07 09:48:58 -05:00
terrafrost
32857c5e7f CS adjustment 2012-10-06 10:50:19 -05:00
terrafrost
ec067c1f14 Merge pull request #23 from monnerat/newattrs
X509: handle multiple-valued attributes in setDNProp(). Fix setDN().
2012-10-06 08:16:15 -07:00
Patrick Monnerat
f4b03722fd X509: handle multiple-valued attributes in setDNProp(). Fix setDN(). 2012-10-01 12:35:43 +02:00
terrafrost
7cfcdf90f6 Merge branch 'master' of https://github.com/phpseclib/phpseclib 2012-09-30 21:37:25 -05:00
terrafrost
bb4995e446 Add $extra to logs 2012-09-30 21:32:26 -05:00
terrafrost
f8b05fb6ad Merge pull request #22 from monnerat/newattrs
X509: Fix 'OU' attribute mapping, add 'SN' (surname) short name, add 'ro...
2012-09-29 17:46:08 -07:00
terrafrost
ee25c73a44 Three fixes
- Ingore white space in keys
- Handle negative numbers in the same way OpenSSL seems to handle them
- Fix signature verification (thanks Richard Odekerken!)
2012-09-29 14:32:27 -05:00
Patrick Monnerat
45512c7a50 X509: Fix emailAddress attribute name mapping. 2012-09-27 16:50:58 +02:00
Patrick Monnerat
1377d56a4e X509: fix typo: improve new DN attrs handling. 2012-09-27 15:15:12 +02:00
Patrick Monnerat
29b9642965 X509: Fix 'OU' attribute mapping, add 'SN' (surname) short name, add 'role', 'title', 'description', 'x500UniqueIdentifier' DN attributes. 2012-09-27 14:38:37 +02:00
terrafrost
076050cc19 Ignore white spaces in CSRs and X.509 certs 2012-09-26 00:34:37 -05:00
terrafrost
13eed6147a Do CRYPT_DES_MODE_CBC instead of CRYPT_MODE_DES_CBC 2012-09-22 11:38:09 -05:00
terrafrost
6686e203e7 Reformat keys even if private key format is the same OpenSSL uses
As is private keys weren't being encrypted when a private key was being set and OpenSSL was being used.

Thanks TeigneuX!
2012-09-18 05:17:14 -05:00
terrafrost
ec5aead746 SSH-2.0-SSHD doesn't implement hmac-*-96 correctly 2012-09-17 02:33:03 -05:00
terrafrost
c7d6492f43 stat() and lstat() ignore false output from _stat()
Thanks Fluffycloud!
2012-09-16 18:50:16 -05:00
terrafrost
31ad9aacbd stream_set_blocking calls were unnecessary 2012-09-09 23:45:18 -05:00