21 Commits

Author SHA1 Message Date
David Ostrovsky
c5f8066629 Don't ship bouncycastle libraries in plugin API
We cannot shade bouncycastle in the plugin API. Still we need it to be
included in the gerrit.war, licenses file and Eclipse classpath.

Expose bouncycastle libraries in PLUGIN_TEST_DEPS constant, so that
the plugins don't need to change anything in tree build mode.

gerrit_api() bazlet in bazlets repository is extended too, so that the
plugins don't need to change anything in standalone build mode.

One side effect of this change, is that bouncycastle libraries are
now listed with neverlink suffix, e.g.:

* bouncycastle:bcprov-neverlink

Bug: Issue 5826
Change-Id: Idb8051e16b14e20c8dd528783ab297ee25707bb3
2017-04-07 07:38:04 +02:00
David Pursehouse
9561f38f14 Format BUILD and WORKSPACE files with buildifier
Formatted with buildifier version 0.4.3 installed via homebrew
on OSX.

Change-Id: Iab54e118a5d119b5c031838c267b848b8ead30f2
2017-02-28 17:32:44 +09:00
Han-Wen Nienhuys
6471e8a94a Ship BouncyCastle in the .war files.
Per
https://www.bis.doc.gov/index.php/forms-documents/encryption/328-flowchart-2/file
open source crypto software can be self-classified as 5D002, and
requires only notification of the U.S. Bureau of Industry and
Security.

This registration has been performed by Google, as of Feb 15, 2017.

This gets rid of the special casing for BouncyCastle, simplifying our
build and deployment process.

Change-Id: I680b0a001e5e2e497ed6e62c90c8b8be30efff48
2017-02-15 13:48:57 +01:00
David Ostrovsky
fdbfcad77d Remove Buck based build
Bug: Issue 5302
Change-Id: I6e860446ef30ff0ad1c7c49fc0e39d39d921820b
2017-01-23 12:44:58 +00:00
Paladox
10649e4550 Update bouncy castle to 1.56
See release notes at https://www.bouncycastle.org/releasenotes.html

Change-Id: Id0c5b1e929118469b4a80252e44a201b7b8f62f5
2017-01-11 23:05:10 +00:00
David Ostrovsky
fa18907d7f Bazel: Reformat build files
Reformat the Bazel build files with the buildifier tool [1].

The style is different for Bazel files. Most notably, indentation level
is 4 spaces instead of 2, and " is used instead of '.

[1] https://github.com/bazelbuild/buildifier

Change-Id: I95c0c6f11b6d76572797853b4ebb5cee5ebd3c98
2016-12-07 11:33:07 +00:00
David Ostrovsky
098b7d4480 Bump bouncy castle to 1.55
Change-Id: Ic1331b5ad8196e62e4f1681c3fd8a3fce3645aec
2016-10-25 12:21:22 +00:00
Yuxuan 'fishy' Wang
75b98f77d9 bazel: add license to appropriate lib/ targets
This is to prepare for implementing genlicenses rule in bazel.

Change-Id: I60d79d5b53f9dd05c9f9ebfe6e6f658604c5a037
2016-09-26 16:42:38 +08:00
David Ostrovsky
b81b4f75ae Implement Bazel build
To run the tests:

  bazel test //...

To build the Gerrit plugin API, run:

  bazel build gerrit-plugin-api:plugin-api_deploy.jar

To build the Gerrit extension API, run:

  bazel build gerrit-extension-api:extension-api_deploy.jar

TODOs:

Licenses
Reduce visibility (all public for now)
Generate HTML Documentation
Core plugins
gerrit_plugin() rule to build plugins in tree and standalone modes
GWT UI (only gwt_module() skylark rule is provided, no gwt_binary())
PolyGerrit UI
WAR
Publish artifacts to Maven Central
Ask Bazel team to add Gerrit to their CI on ci.bazel.io

Contributed-By: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I9a86e670882a44a5c966579cdeb8ed79b1590de3
2016-06-14 21:12:02 +02:00
David Pursehouse
4d0be7a234 bouncycastle: Correct comment with path to libraries.config
Change-Id: I397dd5d48f2be7bcdd68e341c83fa73c53a3e664
2016-03-17 22:01:11 +09:00
Doug Kelly
920b1667d4 Correct issue with Bouncy Castle code signing
If the Bouncy Castle Crypto libraries are unsigned, issues result with
the Eclipse build, since they rely on the copy that exists in the
libraries copied by the download_file.py script.  As a workaround, use
a genrule in ConvertKey to unsign the JARs manually.

Change-Id: I44d6ad5b05a18258e8bf5400c42f1cbd159e59b2
2015-11-10 13:00:26 -08:00
Doug Kelly
1cbfe97c91 Changing the SSH key converter to BUCK
Since we're a BUCK shop, convert the SSH key converter accordingly.
This requires we mark Bouncy Castle as unsign, even though we
do not include this in our normal Gerrit builds.  Also, we had to
add slf4j-nop, since this app doesn't require logging.

Change-Id: I85031192f9172a90512d5f28cf1621c10ad6ebf4
2015-11-09 10:59:32 -08:00
David Pursehouse
cc0f002edf Revert "Exclude bouncycastle key files to fix SecurityException upon plugin-api"
During server startup the warning:

  Disabling cipher <name>: JCE cannot authenticate the provider BC

is emitted for each cipher [1],

and when using SSH, all git operations fail with the error:

  no matching cipher found [2].

This reverts commit 3420d83f39bca93752e62e28080bb65cf4e000d4.

[1] http://paste.openstack.org/show/460590/
[2] http://paste.openstack.org/show/460591/

Change-Id: I8352d6074120f1c148a12d16a013da5965308d9e
2015-09-14 11:07:38 +09:00
Marco Miller
3420d83f39 Exclude bouncycastle key files to fix SecurityException upon plugin-api
Exclude the 2 bouncycastle key files from the 2 downloaded jar files
that are repackaged into our gerrit plugin-api jar. Do so in order to
fix a SecurityException [1] thrown upon using the plugin api from plugin
IT tests [2] in standalone (non-tree) mode.

Indeed, BCKEY.DSA and BCKEY.SF used to be repackaged under META-INF/ in
our gerrit plugin-api jar. Doing so caused that exception [1], as such
BCKEY files did not properly sign our built plugin-api jar; they
strictly belonged to their 2 mother bouncycastle jar files. Our jar used
to have 2 sets of such key files, one set coming from bcprov and the
other from bcpg (the 2 bouncycastle libs involved herein). This fix
removes them all 4 (BC key files) from the resulting plugin-api jar:

jar tvf gerrit-plugin-api-2.12-SNAPSHOT.jar | grep BCKEY
=> (before this fix)
 26965 Sun Mar 01 12:09:10 EST 2015 META-INF/BCKEY.SF
  2219 Sun Mar 01 12:09:10 EST 2015 META-INF/BCKEY.DSA
269297 Sun Mar 01 12:09:32 EST 2015 META-INF/BCKEY.SF
  2219 Sun Mar 01 12:09:32 EST 2015 META-INF/BCKEY.DSA

This fix is first for plugin IT tests [2], which expose this issue as
the first 'pure' plugin-api jar loaders. Such BC libs started to be
-needfully- introduced in acceptance testing by commit ed170f3.

[1] java.lang.SecurityException: Invalid signature file digest for
Manifest main attributes

[2] https://gerrit-review.googlesource.com/#/q/topic:Plugin-IT-tests

Change-Id: Iea2c61ea026e8ee17684a82f0ec41d77d30e02e5
2015-09-03 14:45:51 -04:00
Dave Borowitz
2926b3e52b Update Bouncy Castle to 1.52
Change-Id: I0c01a7d279617ae751f0f939ec1587fac12bc471
2015-06-25 11:21:21 -07:00
David Ostrovsky
e2921b62f6 Revert "Downgrade SSHD to 0.9.0-4-g5967cfd"
All versions of SSHD since release 0.10 were suffering from exhaustion
of thread pool. Number of valuable features had to be reverted to
downgrade the SSHD version to 0.9. This blocking bug [1] was fixed [2]
and released in 0.14.0.

Update to the new version of SSHD and revert the downgrade.

This reverts commit bde8e9ac6f26a85c1a757ac0fa298f8b0c3c5783.

[1] https://issues.apache.org/jira/browse/SSHD-348
[2] https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git;a=commitdiff;h=964e76890cf56da4491199860d0ea8276fbd26a6
Change-Id: Ib5faf1df0cb6bde2e2cd554c9311cc5e55095b04
2015-04-06 12:26:07 +09:00
Saša Živkov
bde8e9ac6f Downgrade SSHD to 0.9.0-4-g5967cfd
Since there is no official 0.9.1 release of the SSHD yet, the
0.9.0-4-g5967cfd version was built from the 0.9.x branch and uploaded to
the Google cloud storage.

This change reverts the following Gerrit commits:

3d9c70c SSHD: Update to 0.13.0
52e4e0c Bump SSHD Mina version to 2.0.8
3921163 Don't use deprecated PGPPublicKeyRingCollection constructor
13452f4 Bump Bouncycastle version to 1.51
5f7d5a7 Update EncryptedContactStore to not use deprecated/removed methods
f69698c Update SSHD to 0.11.1-atlassian-1
67c38c8 Added global request handlers to SshDaemon
c31e17f Update sshd to 0.11.0
b9c66ea Bump SSHD version to 0.10.1 and enable nio2 backend

The reason for the downgrade (copied from the change 60161):

SSHD release 0.9 is known to be free from exhausting thread pool problem
[1]. Unfortunately 0.9 release suffers from sporadic handshake failures
[2].  The fix cannot be cleanly cherry-picked to 0.9 release. The back
port of this fix [3] is tracked under its own issue [4], was uploaded as
PR for SSHD Mina's GH repository [5] and merged recently [6].

Moreover, 0.9 suffers from "Authenticated with partial success" issue
[7]
that was fixed by [8], [9]; this patch must be applied as well.

This reverts commit dc7318b8eeda15732d4d2865fc5a7a0a68b3be15.

[1] https://issues.apache.org/jira/browse/SSHD-348
[2] https://issues.apache.org/jira/browse/SSHD-330
[3] https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git;a=commit;\
h=2aed686bdb21681a421033c6ee5997e5cd8a9a83
[4] https://issues.apache.org/jira/browse/SSHD-356
[5] https://github.com/apache/mina-sshd/pull/7
[6] https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git;a=commit;\
h=cc7162acf7ca89561ca57a9c68de735f17bf168b
[7] https://issues.apache.org/jira/browse/SSHD-254
[8] https://git-wip-us.apache.org/repos/asf?p=mina-sshd.git;a=commit;\
h=28a8ae258b08c6b41ab64ac25f2331168dc0415a
[9] https://gerrit-review.googlesource.com/51516

Change-Id: I889fb02c2cb1aa5df2cf8dcabace086f5094a914
2014-12-04 13:51:59 +01:00
David Ostrovsky
13452f46ec Bump Bouncycastle version to 1.51
This version fixed some bugs [1] and latest SSHD release that we need
has upgraded to this version as well: [2].

[1] https://www.bouncycastle.org/releasenotes.html
[2] https://issues.apache.org/jira/browse/SSHD-362

Change-Id: I84aee1e620091bcd49a1f0be47f4da011a8ff3ee
2014-11-06 22:30:40 +09:00
David Ostrovsky
c34d3607ba Install open ssl jar into Gerrit site for bouncycastle crypto provider
937d527ac0e4ee685fccb60ae604406a6638daec upgraded bouncy castle to 1.49.

The old JAR artifact was renamed and split to number of files. For Gerrit
two libraries must be downloaded and be available under `$gerrit_site/lib`:

* bcprov-jdk15on-149.jar
* bcpkix-jdk15on-149.jar

Update download logic to support a basic concept of required dependencies,
ensuring BC provider is downloaded if the SSL library is installed by init.

Change-Id: I60092ebe136f78a5649fe8512737275f50195a34
2013-11-30 10:30:43 -08:00
David Ostrovsky
937d527ac0 Bump bouncycastle verison to 1.49
Many bugs were fixed since version 1.44 that we are using[1].

JARs artifacts were renamed.

[1] http://www.bouncycastle.org/releasenotes.html

Change-Id: Ie2b22328c77b0100dfff61139b737894b88e7664
2013-11-29 08:49:06 +01:00
Shawn Pearce
fd6bb9f6a5 Build with Buck
Implement a new build system using Buck[1], Facebook's
open source clone of Google's internal build system.

  Pros:
  - Concise build language
  - Test and build output is concise
  - Test failures and stack traces show on terminal
  - Reliable incrementals; clean is unnecessary
  - Extensible with simple blocks of Python
  - Fast
      buck: clean: 0.452s, full 1m21.083s [*], no-op:  7.145s,
      mvn:  clean: 4.596s, full 2m53.776s,     no-op: 59.108s,

      [*] full build includes downloading all dependencies,
          time can vary due to remote server performance.

  Cons:
  - No Windows support
  - No native Maven Central support (added by macros)
  - No native GWT, Prolog, or WAR support (added by macros)
  - Bootstrap of buck requires Ant

Getting started:

  git clone https://gerrit.googlesource.com/buck
  cd buck
  ant

  Mac OS X:
    PATH="`pwd`/bin:/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands:$PATH"

  Linux:
    PATH="`pwd`/bin:$PATH"

Importing into Eclipse:

  $ time buck build :eclipse
  0m48.949s

  Import existing project from `pwd`
  Import 'gerrit' (do not import other Maven based projects)
  Expand 'gerrit'
  Right click 'buck-out' > Properties
  Under Attributes check 'Derived'

  If the code doesn't currently compile but an updated classpath
  is needed, refresh the configs and obtain missing JARs:

  $ buck build :eclipse_project :download

Running JUnit tests:

  $ time buck test --all -e slow  # skip slow tests
  0m19.320s

  $ time buck test --all          # includes acceptance tests
  5m17.517s

Building WAR:

  $ buck build :gerrit
  $ java -jar buck-out/gen/gerrit.war

Building release:

  $ buck test --all && buck build :api :release
  $ java -jar buck-out/gen/release.war
  $ ls -lh buck-out/gen/{extension,plugin}-api.jar

Downloading dependencies:

  Dependencies are normally downloaded automatically, but Buck can
  inspect its graph and download missing dependencies so future
  compiles can run without the network:

  $ buck build :download

[1] http://facebook.github.io/buck/

Change-Id: I40853b108bd8e153cefa0896a5280a9a5ff81655
2013-05-09 13:40:36 +00:00