< prev index next >

src/java.base/share/classes/sun/security/x509/X509CRLImpl.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 368,387 **** } if (signedCRL == null) { throw new CRLException("Uninitialized CRL"); } Signature sigVerf = null; - String sigName = sigAlgId.getName(); if (sigProvider.isEmpty()) { ! sigVerf = Signature.getInstance(sigName); } else { ! sigVerf = Signature.getInstance(sigName, sigProvider); } try { ! SignatureUtil.initVerifyWithParam(sigVerf, key, ! SignatureUtil.getParamSpec(sigName, getSigAlgParams())); } catch (ProviderException e) { throw new CRLException(e.getMessage(), e.getCause()); } catch (InvalidAlgorithmParameterException e) { throw new CRLException(e); } --- 368,389 ---- } if (signedCRL == null) { throw new CRLException("Uninitialized CRL"); } Signature sigVerf = null; if (sigProvider.isEmpty()) { ! sigVerf = Signature.getInstance(sigAlgId.getName()); } else { ! sigVerf = Signature.getInstance(sigAlgId.getName(), sigProvider); } + sigVerf.initVerify(key); + + // set parameters after Signature.initSign/initVerify call, + // so the deferred provider selection happens when key is set try { ! SignatureUtil.specialSetParameter(sigVerf, getSigAlgParams()); } catch (ProviderException e) { throw new CRLException(e.getMessage(), e.getCause()); } catch (InvalidAlgorithmParameterException e) { throw new CRLException(e); }
*** 421,440 **** if (signedCRL == null) { throw new CRLException("Uninitialized CRL"); } Signature sigVerf = null; - String sigName = sigAlgId.getName(); if (sigProvider == null) { ! sigVerf = Signature.getInstance(sigName); } else { ! sigVerf = Signature.getInstance(sigName, sigProvider); } try { ! SignatureUtil.initVerifyWithParam(sigVerf, key, ! SignatureUtil.getParamSpec(sigName, getSigAlgParams())); } catch (ProviderException e) { throw new CRLException(e.getMessage(), e.getCause()); } catch (InvalidAlgorithmParameterException e) { throw new CRLException(e); } --- 423,444 ---- if (signedCRL == null) { throw new CRLException("Uninitialized CRL"); } Signature sigVerf = null; if (sigProvider == null) { ! sigVerf = Signature.getInstance(sigAlgId.getName()); } else { ! sigVerf = Signature.getInstance(sigAlgId.getName(), sigProvider); } + sigVerf.initVerify(key); + + // set parameters after Signature.initSign/initVerify call, + // so the deferred provider selection happens when key is set try { ! SignatureUtil.specialSetParameter(sigVerf, getSigAlgParams()); } catch (ProviderException e) { throw new CRLException(e.getMessage(), e.getCause()); } catch (InvalidAlgorithmParameterException e) { throw new CRLException(e); }
< prev index next >