Skip to content

Commit 73f9db4

Browse files
Merge pull request #90 from italiangrid/develop
Align develop-2.1.x with develop
2 parents dcd42c8 + e138cc3 commit 73f9db4

File tree

14 files changed

+167
-29
lines changed

14 files changed

+167
-29
lines changed

.devcontainer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "VOMS core development",
3+
"dockerComposeFile": "compose/docker-compose.yml",
4+
"service": "voms_build",
5+
"workspaceFolder": "/home/build/workspace",
6+
"shutdownAction": "stopCompose"
7+
}

.github/workflows/centos7-build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# Copyright (c) Istituto Nazionale di Fisica Nucleare (INFN). 2016-2020
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
name: CENTOS 7 build
18+
19+
on:
20+
push:
21+
branches: '*'
22+
pull_request:
23+
branches: [ master ]
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
container: italiangrid/voms-build-centos7
29+
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Build
33+
run: ./autogen.sh && ./configure && make && make install

Jenkinsfile

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
#!/usr/bin/env groovy
22

3+
@Library('sd')_
4+
def kubeLabel = getKubeLabel()
5+
36
pipeline {
47

58
agent {
69
kubernetes {
7-
label "voms-${env.JOB_BASE_NAME}-${env.BUILD_NUMBER}"
8-
cloud 'Kube mwdevel'
9-
defaultContainer 'jnlp'
10-
inheritFrom 'ci-template'
11-
containerTemplate {
12-
name 'runner'
13-
image 'voms/voms-build:centos6'
14-
ttyEnabled true
15-
command 'cat'
16-
}
10+
11+
label "${kubeLabel}"
12+
cloud 'Kube mwdevel'
13+
defaultContainer 'runner'
14+
inheritFrom 'ci-template'
15+
containerTemplate {
16+
name 'runner'
17+
image 'italiangrid/voms-build-centos7:latest'
18+
ttyEnabled true
19+
command 'cat'
20+
}
1721
}
1822
}
1923

2024
options {
21-
timeout(time: 1, unit: 'HOURS')
25+
timeout(time: 10, unit: 'MINUTES')
2226
buildDiscarder(logRotator(numToKeepStr: '5'))
2327
}
2428

@@ -27,10 +31,15 @@ pipeline {
2731
stages {
2832
stage ('build') {
2933
steps {
30-
container('runner') {
31-
sh "./autogen.sh"
32-
sh "./configure && make"
33-
}
34+
35+
sh '''#!/bin/bash
36+
set -ex
37+
pwd
38+
ls -lR
39+
./autogen.sh
40+
./configure
41+
make
42+
'''
3443
}
3544
}
3645

compose/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
COMPOSE_PROJECT_NAME=voms-core

compose/docker-compose.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
version: '3.5'
2+
3+
volumes:
4+
vscode-server:
5+
dotlocal:
6+
7+
services:
8+
9+
init:
10+
image: italiangrid/voms-build-centos7:latest
11+
volumes:
12+
- vscode-server:/home/build/.vscode-server
13+
- dotlocal:/home/build/.local
14+
command: sudo chown -R build:build /home/build/.vscode-server /home/build/.local
15+
16+
voms_build:
17+
image: italiangrid/voms-build-centos7:latest
18+
19+
depends_on:
20+
- init
21+
22+
environment:
23+
- TZ=Europe/Rome
24+
25+
volumes:
26+
- vscode-server:/home/build/.vscode-server
27+
- dotlocal:/home/build/.local
28+
- $HOME/grid-security:/etc/grid-security/certificates
29+
- $HOME/ca-bundle:/etc/pki
30+
- $HOME/vomsdir:/etc/grid-security/vomsdir:ro
31+
- $HOME/vomses:/etc/vomses
32+
- $HOME/.globus:/home/build/.globus:ro
33+
- ..:/home/build/workspace:cached
34+
35+
entrypoint: /tini -- sleep infinity
36+
37+
extra_hosts:
38+
- "dev.local.io: 192.168.65.2"

docker/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DOCKER_IMAGE=italiangrid/voms-build-centos7
2+
DOCKER_GIT_TAG_ENABLED=y
3+
DOCKER_OPTS="--rm=true --no-cache"

docker/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM centos:7
2+
3+
# Allow customization of build user ID and name
4+
ARG BUILD_USER=build
5+
ARG BUILD_USER_UID=501
6+
7+
RUN echo "include_only=.garr.it,.cern.ch" >> /etc/yum/pluginconf.d/fastestmirror.conf && \
8+
yum clean all && \
9+
yum install -y hostname epel-release && \
10+
yum -y update && \
11+
yum -y install which wget tar sudo file && \
12+
yum -y install which wget tar sudo file && \
13+
echo '%wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
14+
adduser --uid ${BUILD_USER_UID} ${BUILD_USER} && \
15+
usermod -a -G wheel ${BUILD_USER} && \
16+
yum -y install \
17+
gdb git expat-devel autoconf automake make libtool pkgconfig openssl-devel gsoap-devel \
18+
mysql-devel libxslt docbook-style-xsl doxygen bison gcc-c++ gcc && \
19+
yum clean all && \
20+
rm -rf /var/cache/yum
21+
22+
ENV TINI_VERSION v0.18.0
23+
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
24+
RUN chmod +x /tini
25+
ENTRYPOINT ["/tini", "--"]
26+
27+
# USER $BUILD_USER
28+
# WORKDIR /home/$BUILD_USER

spec/voms-all.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: voms
2-
Version: 2.1.0
2+
Version: 2.1.1
33
Release: 0%{?dist}
44
Summary: The Virtual Organisation Membership Service C++ APIs
55

src/ac/validate.cc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ std::string get_error(int e)
113113
return "VOMS Server contact data missing from AC.";
114114
break;
115115
case AC_ERR_ATTRIB_FQAN:
116-
return "VOMS Attributes absent or misformed.";
116+
return "VOMS Attributes absent or malformed.";
117117
break;
118118
case AC_ERR_EXTS_ABSENT:
119119
return "Required AC extensions missing (NoRevAvail and AuthorityKeyIdentifier)";
@@ -392,6 +392,8 @@ static int checkAttributes(STACK_OF(AC_ATTR) *atts, voms &v)
392392
else
393393
return AC_ERR_ATTRIB_URI;
394394

395+
std::string top_group = "/" + v.voname;
396+
395397
/* scan the stack of IETFATTRVAL to put attribute in voms struct */
396398
for (int i=0; i<sk_AC_IETFATTRVAL_num(values); i++) {
397399
capname = sk_AC_IETFATTRVAL_value(values, i);
@@ -400,6 +402,18 @@ static int checkAttributes(STACK_OF(AC_ATTR) *atts, voms &v)
400402
return AC_ERR_ATTRIB_FQAN;
401403

402404
std::string str = std::string((char*)capname->data, capname->length);
405+
std::string::size_type top_group_size = top_group.size();
406+
std::string::size_type str_size = str.size();
407+
408+
/* The top level group name must be identical to the VO name.
409+
An attribute may end right after the group name, or may continue on
410+
(separated by a "/"). */
411+
if (str.compare(0, top_group_size, top_group)) {
412+
return AC_ERR_ATTRIB_FQAN;
413+
}
414+
else if (str_size > top_group_size && str[top_group_size] != '/') {
415+
return AC_ERR_ATTRIB_FQAN;
416+
}
403417

404418
v.fqan.push_back(str);
405419

src/api/ccapi/api_util.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,13 @@ X509 *vomsdata::check_from_file(AC *ac, std::ifstream &file, const std::string &
614614
X509_EXTENSION *ext=sk_X509_EXTENSION_value(exts, pos);
615615

616616
AC_CERTS *certs = (AC_CERTS *)X509V3_EXT_d2i(ext);
617-
STACK_OF(X509) *certstack = certs->stackcert;
617+
STACK_OF(X509) *certstack = certs != NULL ? certs->stackcert : NULL;
618+
619+
if (certs == NULL || certstack == NULL) {
620+
AC_CERTS_free(certs);
621+
seterror(VERR_SIGN, "Malformed AC: the AC does not contain the issuer certificate chain");
622+
return NULL;
623+
}
618624

619625
bool success = false;
620626
bool final = false;

src/client/vomsclient.cc

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -439,15 +439,9 @@ Client::Client(int argc, char ** argv) :
439439
exit(1);
440440
}
441441
else if (proxyver==0) {
442-
if (version<30)
443-
proxyver = 2;
444-
else if (version < 40)
445-
proxyver = 3;
446-
else
447-
proxyver = 4;
442+
proxyver = 4;
448443

449-
Print(DEBUG) << "Unspecified proxy version, settling on Globus version: "
450-
<< proxyver << std::endl;
444+
Print(DEBUG) << "Unspecified proxy version, settling on version 4 (RFC)" << std::endl;
451445
}
452446

453447
/* PCI extension option */

src/socklib/Client.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ GSISocketClient::Open()
296296
ssl = SSL_new(ctx);
297297
setup_SSL_proxy_handler(ssl, cacertdir);
298298
SSL_set_bio(ssl, conn, conn);
299+
SSL_set_tlsext_host_name(ssl, host.c_str());
299300

300301
conn = NULL;
301302

src/socklib/Server.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,16 @@ GSISocketServer::AcceptGSIAuthentication()
390390
SSL_CTX_load_verify_locations(ctx, NULL, cacertdir);
391391
SSL_CTX_use_certificate(ctx, ucert);
392392
SSL_CTX_use_PrivateKey(ctx,upkey);
393-
SSL_CTX_set_cipher_list(ctx, "ALL:!LOW:!EXP:!MD5:!MD2");
393+
SSL_CTX_set_cipher_list(ctx, "ALL:!LOW:!EXP:!MD5:!MD2:!3DES:!RC4:!IDEA");
394394
SSL_CTX_set_purpose(ctx, X509_PURPOSE_ANY);
395395
SSL_CTX_set_mode(ctx, SSL_MODE_AUTO_RETRY);
396396
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, proxy_verify_callback);
397397
SSL_CTX_set_verify_depth(ctx, 100);
398398
SSL_CTX_set_cert_verify_callback(ctx, proxy_app_verify_callback, 0);
399+
if (!SSL_CTX_set_options(ctx, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1)) {
400+
SetErrorOpenSSL("Cannot set minimum TLS protocol version");
401+
goto err;
402+
}
399403

400404
if (own_stack) {
401405
/*

systemd/voms@.service

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[Unit]
2-
Description=VOMS service for VO %I
2+
Description=VOMS service for VO %i
33

44
[Service]
55
WorkingDirectory=/
66
EnvironmentFile=/etc/sysconfig/voms
77
User=voms
88
Type=forking
9-
ExecStart=/usr/sbin/voms --conf /etc/voms/%I/voms.conf
9+
ExecStart=/usr/sbin/voms --conf /etc/voms/%i/voms.conf
1010
KillMode=process
1111
SuccessExitStatus=1
1212

0 commit comments

Comments
 (0)