[GitHub] tomcat pull request #:
Github user jamesyanfu commented on the pull request: https://github.com/apache/tomcat/commit/7a21583764224eef391c52b5fdbe571290202532#commitcomment-31457694 Great! --- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Security of cluster's EncryptInterceptor
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 All, On 11/20/18 14:02, Christopher Schultz wrote: > All, > > On 11/20/18 13:46, Christopher Schultz wrote: >> All, > >> I'd like a sanity-check on something I've done for the >> EncryptIntercepto r. > >> I'm using CBC mode because any other mode makes no sense. Using >> ECB mode isn't evasive enough and the more elaborate ones >> require that both sides (encrypt/decrypt) agree on the IVs being >> used. Setting both encryption key /and/ IV for the interceptor >> isn't convenient and is likely to cause people to make stupid >> decisions. > >> So I'm using a random IV and using the IV as the first block >> being sent from any sender to the receivers. This prevents >> known-ciphertext analysis if the attacker can see the encrypted >> stream: the IV is random so it's difficult to learn anything >> from the encrypted stream. > >> However, after a single message is sent, the Cipher object is >> returned to its original state and the same IV is used over and >> over again. Key + IV should generally not be re-used together. > >> Right now, the encrypted message looks like this: > >> block_encrypt(IV) + block_encrypt(message_block[0]) + >> block_encrypt(message_block[1]) ... > >> Encrypting the IV allows the receiver to get an initial encrypted >> block that it doesn't care about. It discards the block and then >> message_block[0] can be decrypted with the correct IV (computed >> from the previous ciphertext block, NOT the previous plaintext >> block -- that's how CBC works) and so on. > >> But the IV re-use is bothering me. I think we should change it >> to: > >> IV + block_encrypt(message_block[0]) + >> block_encrypt(message_block[1]) . .. > > >> The sender will need to generate a new IV *for every message*. > >> Then the receiver instead of ignoring the first block will read >> it as an IV which is used to seed the decryption cipher. > >> I believe this will improve the security of the messages being >> sent, but I'd prefer a few second-opinions. > > An alternative is to send a nonce as the first block, rather than > sending the IV itself. This may yield better performance than > re-initializing the Cipher object each time with a new IV. Following-up on this, I believe I have corrected all of the issues raised above except for replay attacks. - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlv8l18ACgkQHPApP6U8 pFjufQ//RVHyRj5NKs5H6zFyzcLqwhqiPOtLpeLdV/VDHLwmzuGiTnZOyqUCzEYU 0Js8elWNqEEJABOBVUhw3wI4Qn+bPNsIfwqVQfOJ+hGEZEwwFv+NCP3/d6jC5AnJ T8APixHCWSKus9SM18EH5Ss04vgimVQN2TmTeueEjjkTS0YyegSbA1tkt3Tr/QKA 5BmLtQ/Sp/AgfXGhTi2yS60nCjPawadozuCrNEc5irE5NycAybz0zMZO1jJqAtez QNfuJ3s+2+cbGxA1xUZW8btxY/RxGq0MaFC1cqPPRABS+WwhtZRznopwpHsV6+2p zo9bM6M1XW0bZP5CaebcjIHgth1tqGpmkuYUjN1ovfDiYiPMIB6cnHJmX7Ze54FE D2bEK482tB8PuljO8A6QFVNMPkCv7RNLDNR3oAl/cC7+o70ho2j5kz4/P8Sjwv5S SsgoiZIdn5MWp4geRehBWxACemjWYL71e/zjUsSBWHYZ9nhHGWirbO59jPzoTDk5 97uj38pFYpLmBtzYaabQqQdmdO60UtZ2VmR/OoNrKM4m3KwyVK47bXYVTv1EtdFp f8etrkS6Mj7zmyHpMZ3HmjXYHUQtMVvWoBjwJtOXt1xnMFpbw1auloqWzUypXIYa BwMK7lnpb5vyLxp7ltqPvmz74x+pxkFJ9v+A2b3bk34QeU+WhHw= =/jrv -END PGP SIGNATURE- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Tomcat Wiki] Update of "SupportAndTraining" by dblevins
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification. The "SupportAndTraining" page has been changed by dblevins: https://wiki.apache.org/tomcat/SupportAndTraining?action=diff&rev1=67&rev2=68 Comment: Add Tomitribe to the support list [[https://linuxhostsupport.com|{{https://linuxhostsupport.com/blog/wp-content/uploads/2017/05/linuxhostsupport-300.png|https://linuxhostsupport.com}}]] [[https://linuxhostsupport.com|LinuxHostSupport]] is a server management company that provides Tomcat server support services, including, but not limited to: Tomcat installation services, Tomcat configuration services, Tomcat server migration services etc. You can get a free quote. + + [[https://www.tomitribe.com|{{https://www.tomitribe.com/wp-content/uploads/2018/04/tomitribe.png|https://www.tomitribe.com|width=150}}]] + + Tomitribe was founded by several members of the ASF to be completely dedicated to Tomcat and TomEE offering [[https://www.tomitribe.com|7/24 global support]]. Subscriptions also include 365-day CVE scanning, notification and patching for all versions of Tomcat both EOL and active, and annual professional services and training benefits. === Example company name === Use this example as a basis for your entry. New entries should be added just above this example. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1847504 - in /tomcat/trunk: java/org/apache/catalina/tribes/group/interceptors/EncryptInterceptor.java test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java
Author: schultz Date: Tue Nov 27 00:40:14 2018 New Revision: 1847504 URL: http://svn.apache.org/viewvc?rev=1847504&view=rev Log: Simplify createEncryptionManager method. Document magic numbers in GCMEncryptionManager. Add (disabled) ECB implementation, for completeness. Add unit-test to ensure that ECB mode is not supported. Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/EncryptInterceptor.java tomcat/trunk/test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/EncryptInterceptor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/EncryptInterceptor.java?rev=1847504&r1=1847503&r2=1847504&view=diff == --- tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/EncryptInterceptor.java (original) +++ tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/EncryptInterceptor.java Tue Nov 27 00:40:14 2018 @@ -328,20 +328,19 @@ public class EncryptInterceptor extends algorithmMode = "CBC"; } -// Note: ECB is not an appropriate mode for secure communications. if("GCM".equalsIgnoreCase(algorithmMode)) return new GCMEncryptionManager(algorithm, new SecretKeySpec(encryptionKey, algorithmName), providerName); - -if(!("CBC".equalsIgnoreCase(algorithmMode) +else if("CBC".equalsIgnoreCase(algorithmMode) || "OFB".equalsIgnoreCase(algorithmMode) -|| "CFB".equalsIgnoreCase(algorithmMode))) +|| "CFB".equalsIgnoreCase(algorithmMode)) +return new BaseEncryptionManager(algorithm, +new SecretKeySpec(encryptionKey, algorithmName), +providerName); +//else if("ECB".equalsIgnoreCase(algorithmMode)) { +// Note: ECB is not an appropriate mode for secure communications. +//return new ECBEncryptionManager(algorithm, new SecretKeySpec(encryptionKey, algorithmName), providerName); +else throw new IllegalArgumentException(sm.getString("encryptInterceptor.algorithm.unsupported-mode", algorithmMode)); - -BaseEncryptionManager mgr = new BaseEncryptionManager(algorithm, -new SecretKeySpec(encryptionKey, algorithmName), -providerName); - -return mgr; } private static class BaseEncryptionManager { @@ -406,8 +405,9 @@ public class EncryptInterceptor extends } /** - * Gets the size of the initialization vector for the cipher being used. - * The IV size is often, but not always, the block size for the cipher. + * Gets the size, in bytes, of the initialization vector for the + * cipher being used. The IV size is often, but not always, the block + * size for the cipher. * * @return The size of the initialization vector for this algorithm. */ @@ -550,6 +550,25 @@ public class EncryptInterceptor extends } } +/** + * Implements an EncryptionManager for using GCM block cipher modes. + * + * GCM works a little differently than some of the other block cipher modes + * supported by EncryptInterceptor. First of all, it requires a different + * kind of AlgorithmParameterSpec object to be used, and second, it + * requires a slightly different initialization vector and something called + * an "authentication tag". + * + * The choice of IV length can be somewhat arbitrary, but there is consensus + * that 96-bit (12-byte) IVs for GCM are the best trade-off between security + * and performance. For other block cipher modes, IV length is the same as + * the block size. + * + * The "authentication tag" is a computed authentication value based upon + * the message and the encryption process. GCM defines these tags as the + * number of bits to use for the authentication tag, and it's clear that + * the highest number of bits supported 128-bit provide the best security. + */ private static class GCMEncryptionManager extends BaseEncryptionManager { public GCMEncryptionManager(String algorithm, SecretKeySpec secretKey, String providerName) @@ -559,12 +578,39 @@ public class EncryptInterceptor extends @Override protected int getIVSize() { -return 12; +return 12; // See class javadoc for explanation of this magic number (12) } @Override protected AlgorithmParameterSpec generateIV(byte[] bytes, int offset, int length) { +// See class javadoc for explanation of this magic number (128) return new GCMParameterSpec(128, bytes, offset, length); } } + +@SuppressWarnings("unused") +private stati
buildbot success in on tomcat-trunk
The Buildbot has detected a restored build on builder tomcat-trunk while building . Full details are available at: https://ci.apache.org/builders/tomcat-trunk/builds/3792 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: silvanus_ubuntu Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' triggered this build Build Source Stamp: [branch tomcat/trunk] 1847492 Blamelist: markt Build succeeded! Sincerely, -The Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot failure in on tomcat-trunk
On 26/11/2018 14:53, build...@apache.org wrote: > The Buildbot has detected a new failure on builder tomcat-trunk while > building . Full details are available at: > https://ci.apache.org/builders/tomcat-trunk/builds/3791 > > Buildbot URL: https://ci.apache.org/ > > Buildslave for this Build: silvanus_ubuntu > > Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' > triggered this build > Build Source Stamp: [branch tomcat/trunk] 1847474 > Blamelist: markt > > BUILD FAILED: failed compile_1 For the record, this was triggered by another longer standing intermittent test failure - TestCoyoteOutputStream.NIO2.txt Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1847492 - /tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java
Author: markt Date: Mon Nov 26 21:24:20 2018 New Revision: 1847492 URL: http://svn.apache.org/viewvc?rev=1847492&view=rev Log: Renmove the debug code. Modified: tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java Modified: tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java?rev=1847492&r1=1847491&r2=1847492&view=diff == --- tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java (original) +++ tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java Mon Nov 26 21:24:20 2018 @@ -153,11 +153,8 @@ public class TestAsync extends Http2Test // Body if (!connectionUnlimited || !streamUnlimited) { -// TODO Remove debug code -System.out.println("Read loop 1"); while (output.getBytesRead() < startingWindowSize) { parser.readFrame(true); -System.out.println(output.getBytesRead()); } // Check that the right number of bytes were received @@ -173,11 +170,8 @@ public class TestAsync extends Http2Test sendWindowUpdate(0, windowSizeIncrease); } -// TODO Remove debug code -System.out.println("Read loop 2"); while (output.getBytesRead() < startingWindowSize + windowSizeIncrease) { parser.readFrame(true); -System.out.println(output.getBytesRead()); } // Check that the right number of bytes were received @@ -193,11 +187,8 @@ public class TestAsync extends Http2Test } } -// TODO Remove debug code -System.out.println("Read loop 3"); while (!output.getTrace().endsWith("3-EndOfStream\n")) { parser.readFrame(true); -System.out.println(output.getBytesRead()); } // Check that the right number of bytes were received - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1847491 - in /tomcat/tc8.5.x/trunk: ./ java/org/apache/coyote/http2/Stream.java
Author: markt Date: Mon Nov 26 21:23:30 2018 New Revision: 1847491 URL: http://svn.apache.org/viewvc?rev=1847491&view=rev Log: Fix (hopefully) intermittent HTTP/2 test failures with async I/O. Modified: tomcat/tc8.5.x/trunk/ (props changed) tomcat/tc8.5.x/trunk/java/org/apache/coyote/http2/Stream.java Propchange: tomcat/tc8.5.x/trunk/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Nov 26 21:23:30 2018 @@ -1,2 +1,2 @@ /tomcat/tc8.0.x/trunk:1809644 -/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044,1735480,1735577,1735597,1735599-1735600,1735615,1736145,1736162,1736209,1736280,1736297,1736299,1736489,1736646,1736703,1736836,1736849,1737104-1737105,1737112,1737117,1737119-1737120,1737155,1737157,1737192,1737280,1737339,1737632,1737664,1737715,1737748,1737785,1737834,1737860,1737903,1737959,1738005,1738007,1738014-1738015,1738018,1738022,1738039,1738043,1738059-1738060,1738147,1738149,1738174-1738175,1738261,1738589,1738623-1738625,1738643,1738816,1738850,1738855,1738946-1738948,1738953-1738954,1738979,1738982,1739079-1739081,1739087,1739113,1739153,1739172,1739176,1739191,1739474,1739492,1739726,1739762,1739775,1739814,1739817-1739818,1739975,1740131,1740324,1740465,1740495,1740508-1740509,1740520,1740535,1740707,1740803,1740810,1740969,1740980,1740991,1740997,1741015,1741033,1741036,1741058,1741060,1741080,1741147,1741159,1741164,1741173,1741181,1741190,1741197,1741202,1741208,1741213,1741221,1741225,1741232,1741409 ,1741501,1741677,1741892,1741896,1741984,1742023,1742042,1742071,1742090,1742093,1742101,1742105,1742111,1742139,1742146,1742148,1742166,1742181,1742184,1742187,1742246,1742248-1742251,1742263-1742264,1742268,1742276,1742369,1742387,1742448,1742509-1742512,1742917,1742919,1742933,1742975-1742976,1742984,1742986,1743019,1743115,1743117,1743124-1743125,1743134,1743425,1743554,1743679,1743696-1743698,1743700-1743701,1744058,1744064-1744065,1744125,1744149,1744194,1744229,1744270,1744323,1744432,1744684,1744697,1744705,1744713,1744760,1744786,1745083,1745142-1745143,1745145,1745177,1745179-1745180,1745227,1745248,1745254,1745337,1745467,1745473,1745535,1745576,1745735,1745744,1746304,1746306-1746307,1746319,1746327,1746338,1746340-1746341,1746344,1746427,1746441,1746473,1746490,1746492,1746495-1746496,1746499-1746501,1746503-1746507,1746509,1746549,1746551,1746554,1746556,1746558,1746584,1746620,1746649,1746724,1746939,1746989,1747014,1747028,1747035,1747210,1747225,1747234,1747253,1747 404,1747506,1747536,1747924,1747980,1747993,1748001,1748253,1748452,1748547,1748629,1748676,1748715,1749287,1749296,1749328,1749373,1749465,1749506,1749508,1749665-1749666,1749763,1749865-1749866,1749898,1749978,1749980,1750011,1750015,1750056,1750480,1750617,1750634,1750692,1750697,1750700,1750703,1750707,1750714,1750718,1750723,1750774,1750899,1750975,1750995,1751061,1751097,1751173,1751438,1751447,1751463,1751702,1752212,1752737,1752745,1753078,1753080,1753358,1753363,1754111,1754140-1754141,1754281,1754310,1754445,1754467,1754494,1754496,1754528,1754532-1754533,1754613,1754714,1754874,1754941,1754944,1754950-1754951,1755005,1755007,1755009,1755132,1755180-1755181,1755185,1755190,1755204-1755206,1755208,1755214,1755224,1755227,1755230,1755629,1755646-1755647,1755650,1755653,1755675,1755680,1755683,1755693,1755717,1755731-1755737,1755812,1755828,1755884,1755890,1755918-1755919,1755942,1755958,1755960,1755970,1755993,1756013,1756019,1756039,1756056,1756083-1756114,1756175,1756288-1 756289,1756408-1756410,1756778,1756798,1756878,1756898,1756939,1757123-1757124,1757126,1757128,1757132-1757133,1757136,1757145,1757167-1757168,1757175,1757180,1757182,1757195,1757271,1757278,1757347,1757353-1757354,1757363,1757374,1757399,1757406,1757408,1757485,1757495,1757499,1757527,1757578,1757684,1757722,1757727,1757790,1757799,1757813,1757853,1757883,1757903,1757976,1757997,1758000,1758058,1758072-1758075,1758078-1758079,1758223,1758257,1758261,1758276,1758292,1758369,1758378-1758383,1758421,1758423,1758425-1758427,1758430,1758443,1758448,1758459,1758483,1758486-1758487,1758499,1758525,1758556,1758580,1758582,1758584,1758588,1758842,1759019,1759212,1759224,1759227,1759252,1759274,1759513-1759516,1759611,1759757,1759785-1759790,1760005,1760022,1760109-1760110,1760135,1760200-1760201,1760227,1760300,1760397,1760446,1760454,1760640,1760648,1761057,1761422,1761491,1761498,1761500-1761501,1761550,1761553,1761572,1761574,1761625-1761626,1761628,1761682,1761740,1761752,1762051-176205 3,1762123,1762168,1762172,1762182,1762201-1762202,1762204,1762208,1762288,1762296,1762324,1762348,1762353,1762362,1762374,1762492,1762503,1762505,1762541,1762608,1762710,1762753,1762766,1762769,1762944,1762947,1762953,1763167,1763179,1763232,1763259,1763271-1763272,1763276-1763277,1763319-1763320,1763370,1763372,1763375,1763377,1763393,1763412,1763430,1763450,1763462,1763505,1763511-1763512,1763516,1763518,1763520,1763529,1763559,1763565,1763568,
svn commit: r1847490 - in /tomcat/tc8.5.x/trunk: ./ test/org/apache/coyote/http2/TestAsync.java
Author: markt Date: Mon Nov 26 21:23:03 2018 New Revision: 1847490 URL: http://svn.apache.org/viewvc?rev=1847490&view=rev Log: Fix typo Modified: tomcat/tc8.5.x/trunk/ (props changed) tomcat/tc8.5.x/trunk/test/org/apache/coyote/http2/TestAsync.java Propchange: tomcat/tc8.5.x/trunk/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Nov 26 21:23:03 2018 @@ -1,2 +1,2 @@ /tomcat/tc8.0.x/trunk:1809644 -/tomcat/trunk:1734785,1734799,1734845,1734928,1735041,1735044,1735480,1735577,1735597,1735599-1735600,1735615,1736145,1736162,1736209,1736280,1736297,1736299,1736489,1736646,1736703,1736836,1736849,1737104-1737105,1737112,1737117,1737119-1737120,1737155,1737157,1737192,1737280,1737339,1737632,1737664,1737715,1737748,1737785,1737834,1737860,1737903,1737959,1738005,1738007,1738014-1738015,1738018,1738022,1738039,1738043,1738059-1738060,1738147,1738149,1738174-1738175,1738261,1738589,1738623-1738625,1738643,1738816,1738850,1738855,1738946-1738948,1738953-1738954,1738979,1738982,1739079-1739081,1739087,1739113,1739153,1739172,1739176,1739191,1739474,1739492,1739726,1739762,1739775,1739814,1739817-1739818,1739975,1740131,1740324,1740465,1740495,1740508-1740509,1740520,1740535,1740707,1740803,1740810,1740969,1740980,1740991,1740997,1741015,1741033,1741036,1741058,1741060,1741080,1741147,1741159,1741164,1741173,1741181,1741190,1741197,1741202,1741208,1741213,1741221,1741225,1741232,1741409 ,1741501,1741677,1741892,1741896,1741984,1742023,1742042,1742071,1742090,1742093,1742101,1742105,1742111,1742139,1742146,1742148,1742166,1742181,1742184,1742187,1742246,1742248-1742251,1742263-1742264,1742268,1742276,1742369,1742387,1742448,1742509-1742512,1742917,1742919,1742933,1742975-1742976,1742984,1742986,1743019,1743115,1743117,1743124-1743125,1743134,1743425,1743554,1743679,1743696-1743698,1743700-1743701,1744058,1744064-1744065,1744125,1744149,1744194,1744229,1744270,1744323,1744432,1744684,1744697,1744705,1744713,1744760,1744786,1745083,1745142-1745143,1745145,1745177,1745179-1745180,1745227,1745248,1745254,1745337,1745467,1745473,1745535,1745576,1745735,1745744,1746304,1746306-1746307,1746319,1746327,1746338,1746340-1746341,1746344,1746427,1746441,1746473,1746490,1746492,1746495-1746496,1746499-1746501,1746503-1746507,1746509,1746549,1746551,1746554,1746556,1746558,1746584,1746620,1746649,1746724,1746939,1746989,1747014,1747028,1747035,1747210,1747225,1747234,1747253,1747 404,1747506,1747536,1747924,1747980,1747993,1748001,1748253,1748452,1748547,1748629,1748676,1748715,1749287,1749296,1749328,1749373,1749465,1749506,1749508,1749665-1749666,1749763,1749865-1749866,1749898,1749978,1749980,1750011,1750015,1750056,1750480,1750617,1750634,1750692,1750697,1750700,1750703,1750707,1750714,1750718,1750723,1750774,1750899,1750975,1750995,1751061,1751097,1751173,1751438,1751447,1751463,1751702,1752212,1752737,1752745,1753078,1753080,1753358,1753363,1754111,1754140-1754141,1754281,1754310,1754445,1754467,1754494,1754496,1754528,1754532-1754533,1754613,1754714,1754874,1754941,1754944,1754950-1754951,1755005,1755007,1755009,1755132,1755180-1755181,1755185,1755190,1755204-1755206,1755208,1755214,1755224,1755227,1755230,1755629,1755646-1755647,1755650,1755653,1755675,1755680,1755683,1755693,1755717,1755731-1755737,1755812,1755828,1755884,1755890,1755918-1755919,1755942,1755958,1755960,1755970,1755993,1756013,1756019,1756039,1756056,1756083-1756114,1756175,1756288-1 756289,1756408-1756410,1756778,1756798,1756878,1756898,1756939,1757123-1757124,1757126,1757128,1757132-1757133,1757136,1757145,1757167-1757168,1757175,1757180,1757182,1757195,1757271,1757278,1757347,1757353-1757354,1757363,1757374,1757399,1757406,1757408,1757485,1757495,1757499,1757527,1757578,1757684,1757722,1757727,1757790,1757799,1757813,1757853,1757883,1757903,1757976,1757997,1758000,1758058,1758072-1758075,1758078-1758079,1758223,1758257,1758261,1758276,1758292,1758369,1758378-1758383,1758421,1758423,1758425-1758427,1758430,1758443,1758448,1758459,1758483,1758486-1758487,1758499,1758525,1758556,1758580,1758582,1758584,1758588,1758842,1759019,1759212,1759224,1759227,1759252,1759274,1759513-1759516,1759611,1759757,1759785-1759790,1760005,1760022,1760109-1760110,1760135,1760200-1760201,1760227,1760300,1760397,1760446,1760454,1760640,1760648,1761057,1761422,1761491,1761498,1761500-1761501,1761550,1761553,1761572,1761574,1761625-1761626,1761628,1761682,1761740,1761752,1762051-176205 3,1762123,1762168,1762172,1762182,1762201-1762202,1762204,1762208,1762288,1762296,1762324,1762348,1762353,1762362,1762374,1762492,1762503,1762505,1762541,1762608,1762710,1762753,1762766,1762769,1762944,1762947,1762953,1763167,1763179,1763232,1763259,1763271-1763272,1763276-1763277,1763319-1763320,1763370,1763372,1763375,1763377,1763393,1763412,1763430,1763450,1763462,1763505,1763511-1763512,1763516,1763518,1763520,1763529,1763559,1763565,1763568,1763574,1763619,1763634-1763635,1763718,1763748,176378
Re: svn commit: r1847417 - in /tomcat/trunk: java/org/apache/catalina/tribes/group/interceptors/EncryptInterceptor.java test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java w
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 All, On 11/26/18 11:19, Christopher Schultz wrote: > All, > > On 11/25/18 10:49, schu...@apache.org wrote: >> Author: schultz Date: Sun Nov 25 15:49:28 2018 New Revision: >> 1847417 > >> URL: http://svn.apache.org/viewvc?rev=1847417&view=rev Log: Add >> support for GCM block cipher mode. > > It's possible that GCM does not need to have the IV pre-pended to > the output. I'm investigating... Nope, it seems to be the same as with all the other modes. - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlv8HrYACgkQHPApP6U8 pFjWsQ//YPARuzBBY/1oNmHoS9QIc8MBqD/nfLjXhy3aYMcjkwBMI3SXMJCg53wb 44tnS1tlPlKoKOzxJWFOVsZhlKbBqlXbzq9uWacPomtqHRf9MPJ7JCYyN1RhdF8I 0II47WA25DpFMI98x3uCCIlcVvaTHZFn0OIj2KM+jjwPauS1oDIZekRo6S25F0af tfAwQyY3JhzVlxxLH6tdzeFtbIqYzch0rDZPgNYJCHJGIxDf/VDtIzdfHbXqNgYS hzRDey19CtpNKt1yGjL4g4Wj7T4bmISxvG+wZB5gyH8wm5OZ6nJpQjd4Bw2dAhSd Ns4qNIA2UIr3mlhBNR9BbzlKVNaYBzxcvDEgmqf1SCbTmcxwgNcwhPKonwRBL6xW sTrK6RbHbJUJjSRicit2/gFarQFhnuCknI2f/9dJmwajRd6BP6o0Wtav8QxFai6t dbW6x3Kk9iiz7flgr2p7SV0U12Grg6/dwmOzkeEYvQYstfvIQSdjDMtXmWPnqlwB /oLYQNhHO7uOeCEhaQd+1eyYMc8JjRU8hCG5tQnvlTk2MJswyT6UqHO6yxz+ojpU 0a52GoE7qMkjqqBz8+nob5Apb56RXjYx03KnubBrL7ypaRIiE7wnkxPJp9QoQRwN rQ1wdDsMdDDuk7fOTbZOeEJl3lqUp/tdFF2oe7hxjx+XtoOD7lU= =JNhw -END PGP SIGNATURE- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1847417 - in /tomcat/trunk: java/org/apache/catalina/tribes/group/interceptors/EncryptInterceptor.java test/org/apache/catalina/tribes/group/interceptors/TestEncryptInterceptor.java w
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 All, On 11/25/18 10:49, schu...@apache.org wrote: > Author: schultz Date: Sun Nov 25 15:49:28 2018 New Revision: > 1847417 > > URL: http://svn.apache.org/viewvc?rev=1847417&view=rev Log: Add > support for GCM block cipher mode. It's possible that GCM does not need to have the IV pre-pended to the output. I'm investigating... - -chris > Modified: > tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/Encryp tInterceptor.java > > tomcat/trunk/test/org/apache/catalina/tribes/group/interceptors/TestEncr yptInterceptor.java > tomcat/trunk/webapps/docs/changelog.xml > > Modified: > tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/Encryp tInterceptor.java > > URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribe s/group/interceptors/EncryptInterceptor.java?rev=1847417&r1=1847416&r2=1 847417&view=diff > == > > - --- tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/EncryptI nterceptor.java (original) > +++ > tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/Encryp tInterceptor.java > Sun Nov 25 15:49:28 2018 @@ -25,6 +25,7 @@ import > java.util.concurrent.ConcurrentLi > > import javax.crypto.Cipher; import > javax.crypto.NoSuchPaddingException; +import > javax.crypto.spec.GCMParameterSpec; import > javax.crypto.spec.IvParameterSpec; import > javax.crypto.spec.SecretKeySpec; > > @@ -64,7 +65,7 @@ public class EncryptInterceptor extends private > String encryptionKeyString; > > > -private EncryptionManager encryptionManager; +private > BaseEncryptionManager encryptionManager; > > public EncryptInterceptor() { } @@ -300,7 +301,7 @@ public class > EncryptInterceptor extends return result; } > > -private static EncryptionManager > createEncryptionManager(String algorithm, +private static > BaseEncryptionManager createEncryptionManager(String algorithm, > byte[] encryptionKey, String providerName) throws > NoSuchAlgorithmException, NoSuchPaddingException, > NoSuchProviderException { if(null == encryptionKey) @@ -328,29 > +329,31 @@ public class EncryptInterceptor extends } > > // Note: ECB is not an appropriate mode for secure communications. > +if("GCM".equalsIgnoreCase(algorithmMode)) + > return new GCMEncryptionManager(algorithm, new > SecretKeySpec(encryptionKey, algorithmName), providerName); + > if(!("CBC".equalsIgnoreCase(algorithmMode) || > "OFB".equalsIgnoreCase(algorithmMode) || > "CFB".equalsIgnoreCase(algorithmMode))) throw new > IllegalArgumentException(sm.getString("encryptInterceptor.algorithm.un supported-mode", > algorithmMode)); > > -EncryptionManager mgr = new EncryptionManager(algorithm, + > BaseEncryptionManager mgr = new BaseEncryptionManager(algorithm, > new SecretKeySpec(encryptionKey, algorithmName), providerName); > > return mgr; } > > -private static class EncryptionManager { +private static > class BaseEncryptionManager { /** * The fully-specified algorithm > e.g. AES/CBC/PKCS5Padding. */ private final String algorithm; > > /** - * The size of the initialization vector to use for > encryption. This is - * often, but not always, the same as > the block size. + * The block size of the cipher. */ - > private final int ivSize; +private final int blockSize; > > /** * The cryptographic provider name. @@ -375,7 +378,7 @@ public > class EncryptInterceptor extends */ private final > ConcurrentLinkedQueue randomPool; > > -public EncryptionManager(String algorithm, SecretKeySpec > secretKey, String providerName) +public > BaseEncryptionManager(String algorithm, SecretKeySpec secretKey, > String providerName) throws NoSuchAlgorithmException, > NoSuchPaddingException, NoSuchProviderException { this.algorithm = > algorithm; this.providerName = providerName; @@ -383,7 +386,7 @@ > public class EncryptInterceptor extends > > cipherPool = new ConcurrentLinkedQueue<>(); Cipher cipher = > createCipher(); -ivSize = cipher.getBlockSize(); + > blockSize = cipher.getBlockSize(); cipherPool.offer(cipher); > randomPool = new ConcurrentLinkedQueue<>(); } @@ -402,8 +405,14 @@ > public class EncryptInterceptor extends return secretKey; } > > -private int getIVSize() { -return ivSize; + > /** + * Gets the size of the initialization vector for the > cipher being used. + * The IV size is often, but not > always, the block size for the cipher. + * + * > @return The size of the initialization vector for this algorithm. + > */ +protected int getIVSize() { +return > blockSize; } > > private String getProviderName() { @@ -474,7 +483,7 @@ public class > EncryptInterceptor extends > > try { cipher = getCipher(); - > cipher.init(Cipher.ENCRYPT_MODE, getSecretKey(), generateIV(iv, 0, > ivSize)); +cipher.init(Cipher.E
buildbot failure in on tomcat-trunk
The Buildbot has detected a new failure on builder tomcat-trunk while building . Full details are available at: https://ci.apache.org/builders/tomcat-trunk/builds/3791 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: silvanus_ubuntu Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' triggered this build Build Source Stamp: [branch tomcat/trunk] 1847474 Blamelist: markt BUILD FAILED: failed compile_1 Sincerely, -The Buildbot - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1847474 - /tomcat/trunk/java/org/apache/coyote/http2/Stream.java
Author: markt Date: Mon Nov 26 14:24:45 2018 New Revision: 1847474 URL: http://svn.apache.org/viewvc?rev=1847474&view=rev Log: Fix (hopefully) intermittent HTTP/2 test failures with async I/O. Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Stream.java?rev=1847474&r1=1847473&r2=1847474&view=diff == --- tomcat/trunk/java/org/apache/coyote/http2/Stream.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Stream.java Mon Nov 26 14:24:45 2018 @@ -717,6 +717,10 @@ class Stream extends AbstractStream impl private final ByteBuffer buffer = ByteBuffer.allocate(8 * 1024); private final WriteBuffer writeBuffer = new WriteBuffer(32 * 1024); +// Flag that indicates that data was left over on a previous +// non-blocking write. Once set, this flag stays set until all the data +// has been written. +private boolean dataLeft; private volatile long written = 0; private int streamReservation = 0; private volatile boolean closed = false; @@ -747,6 +751,7 @@ class Stream extends AbstractStream impl // is full if (flush(true, coyoteResponse.getWriteListener() == null)) { writeBuffer.add(chunk); +dataLeft = true; break; } } @@ -767,17 +772,20 @@ class Stream extends AbstractStream impl * Too many calls and the end of stream message is sent too soon and * trailer headers are not sent. */ -boolean dataLeft = buffer.position() > 0; +boolean dataInBuffer = buffer.position() > 0; boolean flushed = false; -if (dataLeft) { -dataLeft = flush(false, block); +if (dataInBuffer) { +dataInBuffer = flush(false, block); flushed = true; } -if (!dataLeft) { +if (!dataInBuffer) { if (writeBuffer.isEmpty()) { -if (!flushed) { +// Both buffer and writeBuffer are empty. +if (flushed) { +dataLeft = false; +} else { dataLeft = flush(false, block); } } else { @@ -811,10 +819,10 @@ class Stream extends AbstractStream impl if (streamReservation == 0) { streamReservation = reserveWindowSize(left, block); if (streamReservation == 0) { -// Must be non-blocking. Unwritten non-blocking data -// must put in writeBuffer else isReady() logic breaks -writeBuffer.add(buffer); -buffer.clear(); +// Must be non-blocking. +// Note: Can't add to the writeBuffer here as the write +// may originate from the writeBuffer. +buffer.compact(); return true; } } @@ -822,10 +830,10 @@ class Stream extends AbstractStream impl int connectionReservation = handler.reserveWindowSize(Stream.this, streamReservation, block); if (connectionReservation == 0) { -// Must be non-blocking. Unwritten non-blocking data -// must put in writeBuffer else isReady() logic breaks -writeBuffer.add(buffer); -buffer.clear(); +// Must be non-blocking. +// Note: Can't add to the writeBuffer here as the write +// may originate from the writeBuffer. +buffer.compact(); return true; } // Do the write @@ -841,7 +849,7 @@ class Stream extends AbstractStream impl } final synchronized boolean isReady() { -if (getWindowSize() > 0 && handler.getWindowSize() > 0 && writeBuffer.isEmpty()) { +if (getWindowSize() > 0 && handler.getWindowSize() > 0 && !dataLeft) { return true; } else { return false; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1847472 - /tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java
Author: markt Date: Mon Nov 26 14:06:23 2018 New Revision: 1847472 URL: http://svn.apache.org/viewvc?rev=1847472&view=rev Log: Fix typo Modified: tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java Modified: tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java?rev=1847472&r1=1847471&r2=1847472&view=diff == --- tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java (original) +++ tomcat/trunk/test/org/apache/coyote/http2/TestAsync.java Mon Nov 26 14:06:23 2018 @@ -120,7 +120,7 @@ public class TestAsync extends Http2Test sendClientPreface(); validateHttp2InitialResponse(); -// Reset connection window size after intial response +// Reset connection window size after initial response sendWindowUpdate(0, SimpleServlet.CONTENT_LENGTH); if (largeInitialWindow) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Container packaging
On Sat, Nov 24, 2018 at 12:19 AM Mark Thomas wrote: > On 23/11/2018 12:57, Rémy Maucherat wrote: > > On Fri, Nov 23, 2018 at 1:22 PM Mark Thomas wrote: > > > > >> This is a docker image, right? > >> > > > > A bit. There are standard Tomcat images already > > https://hub.docker.com/_/tomcat/ but they are more complex. > > So this one is a Maven pom to get an embedded "standalone" Tomcat with > the > > specified Tomcat components, it can be used for that (people like Maven). > > Then there is a simple dockerfile to build a custom image with it. I'll > > refine it, but I used it to redo the kubernetes testing. > > So do should we be aiming to get the POM on Maven central? What about > the other files? In some sort of archive? > > Separately, do we want this git repo somewhere official as far as the > ASF in concerned? I see no reason why not. > Ok, so I have a POM to build a standalone JAR, a readme and the simplest dockerfile to use the produced packaging. Then it is useful to provide in some way the base utility webapps (manager, maybe root as a placeholder - host-manager is probably not super useful since this is for simple services consisting of maybe a handful webapps) and the config files (right now, it can use the same as Tomcat standalone). Still trying to figure out the best options. Rémy
svn commit: r1847469 - /tomcat/trunk/java/org/apache/coyote/http2/Stream.java
Author: markt Date: Mon Nov 26 13:48:02 2018 New Revision: 1847469 URL: http://svn.apache.org/viewvc?rev=1847469&view=rev Log: No need for streamReservation to be volatile. It is used only inside a single synchronised method. Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java Modified: tomcat/trunk/java/org/apache/coyote/http2/Stream.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http2/Stream.java?rev=1847469&r1=1847468&r2=1847469&view=diff == --- tomcat/trunk/java/org/apache/coyote/http2/Stream.java (original) +++ tomcat/trunk/java/org/apache/coyote/http2/Stream.java Mon Nov 26 13:48:02 2018 @@ -718,7 +718,7 @@ class Stream extends AbstractStream impl private final ByteBuffer buffer = ByteBuffer.allocate(8 * 1024); private final WriteBuffer writeBuffer = new WriteBuffer(32 * 1024); private volatile long written = 0; -private volatile int streamReservation = 0; +private int streamReservation = 0; private volatile boolean closed = false; private volatile boolean endOfStreamSent = false; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 62945] JarScanFilter with tldSkip in context.xml still produce INFO msg. if one jar is scanned due to another reason
https://bz.apache.org/bugzilla/show_bug.cgi?id=62945 --- Comment #3 from Remy Maucherat --- (In reply to Andrei Costescu from comment #2) > It would be nice if the default config (that seems to be aware of > log4j-web*.jar already) would not - by default - assume that this jar has > also TLDs. That would require though that the global config needs to > allow/disallow jar scanning at a more granular level (so in this case > separate properties that apply only for TLD scanning). > > Could the default config be modified in that way? Current approach works but > I don't like the copy/paste needed to override jarsToScan with tldScan > (default jarsToScan could be changed I guess in future versions). Although > of course in the end the .war knows what is in it and can adjust these lists > to compensate for defaults. log4j-web isn't useful for TLDs, but contains other components which are scanned. Although it could be separate, both TLD and "other" scanning use the same default list, which means you can get the message for them. -- You are receiving this mail because: You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org