@@ -150,18 +150,6 @@ public function getAccessTokenOptions($method, array $params)
150150 ['hashAlgorithm ' => $ hashAlgorithm , 'signAlgorithm ' => $ signAlgorithm ] = Module::findHashAndSignAlgorithm ($ signatureAlgorithmOid );
151151 $ module ->setDigest ($ hashAlgorithm );
152152
153- // create a collector instance
154- $ collector = new Collector (new Collection ($ certificates ));
155- // collect revocation information for this certificate
156- $ vriData = $ collector ->getByCertificate ($ certificate );
157-
158- foreach ($ vriData ->getOcspResponses () as $ ocspResponse ) {
159- $ module ->addOcspResponse ($ ocspResponse );
160- }
161- foreach ($ vriData ->getCrls () as $ crl ) {
162- $ module ->addCrl ($ crl );
163- }
164-
165153 $ signer ->setSignatureContentLength (20000 );
166154 $ tmpDocument = $ signer ->preSign (
167155 new FileWriter (TempFileWriter::createTempPath ()),
@@ -175,7 +163,8 @@ public function getAccessTokenOptions($method, array $params)
175163 $ authorizationUrl = $ provider ->getAuthorizationUrl ([
176164 'scope ' => 'credential ' ,
177165 'credentialID ' => $ credentialId ,
178- 'hash ' => $ hashData
166+ 'hash ' => $ hashData ,
167+ 'numSignatures ' => 1 ,
179168 ]);
180169
181170 $ _SESSION [__FILE__ ] = [
@@ -186,7 +175,6 @@ public function getAccessTokenOptions($method, array $params)
186175 'signAlgorithm ' => $ signAlgorithm ,
187176 'signAlgorithmOid ' => $ signatureAlgorithmOid ,
188177 'certificates ' => $ certificates ,
189- 'vriData ' => $ vriData ,
190178 'oauth2state ' => $ provider ->getState (),
191179 ];
192180
@@ -230,7 +218,7 @@ public function getAccessTokenOptions($method, array $params)
230218 Digest::$ oids [$ module ->getDigest ()],
231219 isset ($ signatureAlgorithmParameters ) ? (string )$ signatureAlgorithmParameters : null
232220 );
233- // var_dump($result);
221+
234222 $ signatureValue = (string ) \base64_decode ($ result ['signatures ' ][0 ]);
235223 if ($ _SESSION [__FILE__ ]['signAlgorithm ' ] === Digest::ECDSA_ALGORITHM ) {
236224 $ signatureValue = Module::fixEccSignatures ($ signatureValue );
@@ -259,14 +247,11 @@ public function getAccessTokenOptions($method, array $params)
259247
260248 // create a VRI collector instance
261249 $ collector = new Collector (new Collection ($ _SESSION [__FILE__ ]['certificates ' ]));
262- $ vriData = $ collector ->getByFieldName (
263- $ document ,
264- $ fieldName ,
265- Collector::SOURCE_OCSP_OR_CRL ,
266- null ,
267- null ,
268- $ _SESSION [__FILE__ ]['vriData ' ] // pass the previously gathered VRI data
250+ $ collector ->setAllowTrustedIntermediateCertificatesWithoutVri (
251+ isset ($ settings ['allowTrustedIntermediateCertificatesWithoutVri ' ])
269252 );
253+
254+ $ vriData = $ collector ->getByFieldName ($ document , $ fieldName );
270255 // and add it to the document.
271256 $ dss = new DocumentSecurityStore ($ document );
272257 $ dss ->addValidationRelatedInfoByFieldName (
0 commit comments