src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java
changeset 55715 e2af6324d67c
parent 53064 103ed9569fc8
equal deleted inserted replaced
55714:e17ec6bc670a 55715:e2af6324d67c
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   722             }
   722             }
   723 
   723 
   724             // Update the context.
   724             // Update the context.
   725             chc.handshakeExtensions.put(
   725             chc.handshakeExtensions.put(
   726                     SH_STATUS_REQUEST, CertStatusRequestSpec.DEFAULT);
   726                     SH_STATUS_REQUEST, CertStatusRequestSpec.DEFAULT);
   727             chc.handshakeConsumers.put(SSLHandshake.CERTIFICATE_STATUS.id,
       
   728                     SSLHandshake.CERTIFICATE_STATUS);
       
   729 
   727 
   730             // Since we've received a legitimate status_request in the
   728             // Since we've received a legitimate status_request in the
   731             // ServerHello, stapling is active if it's been enabled.
   729             // ServerHello, stapling is active if it's been enabled.
   732             chc.staplingActive = chc.sslContext.isStaplingEnabled(true);
   730             chc.staplingActive = chc.sslContext.isStaplingEnabled(true);
       
   731             if (chc.staplingActive) {
       
   732                 chc.handshakeConsumers.put(SSLHandshake.CERTIFICATE_STATUS.id,
       
   733                     SSLHandshake.CERTIFICATE_STATUS);
       
   734             }
   733 
   735 
   734             // No impact on session resumption.
   736             // No impact on session resumption.
   735         }
   737         }
   736     }
   738     }
   737 
   739 
  1077             }
  1079             }
  1078 
  1080 
  1079             // Update the context.
  1081             // Update the context.
  1080             chc.handshakeExtensions.put(
  1082             chc.handshakeExtensions.put(
  1081                     SH_STATUS_REQUEST_V2, CertStatusRequestV2Spec.DEFAULT);
  1083                     SH_STATUS_REQUEST_V2, CertStatusRequestV2Spec.DEFAULT);
  1082             chc.handshakeConsumers.put(SSLHandshake.CERTIFICATE_STATUS.id,
  1084 
       
  1085             // Since we've received a legitimate status_request in the
       
  1086             // ServerHello, stapling is active if it's been enabled.  If it
       
  1087             // is active, make sure we add the CertificateStatus message
       
  1088             // consumer.
       
  1089             chc.staplingActive = chc.sslContext.isStaplingEnabled(true);
       
  1090             if (chc.staplingActive) {
       
  1091                 chc.handshakeConsumers.put(SSLHandshake.CERTIFICATE_STATUS.id,
  1083                     SSLHandshake.CERTIFICATE_STATUS);
  1092                     SSLHandshake.CERTIFICATE_STATUS);
  1084 
  1093             }
  1085             // Since we've received a legitimate status_request in the
       
  1086             // ServerHello, stapling is active if it's been enabled.
       
  1087             chc.staplingActive = chc.sslContext.isStaplingEnabled(true);
       
  1088 
  1094 
  1089             // No impact on session resumption.
  1095             // No impact on session resumption.
  1090         }
  1096         }
  1091     }
  1097     }
  1092 
  1098