if (!WebUtils.isHttp(subjectContext)) { if (log.isDebugEnabled()) { Stringmsg="SubjectContext argument is not an HTTP-aware instance. This is required to obtain a " + "servlet request and response in order to retrieve the rememberMe cookie. Returning " + "immediately and ignoring rememberMe operation."; log.debug(msg); } returnnull; }
WebSubjectContextwsc= (WebSubjectContext) subjectContext; if (isIdentityRemoved(wsc)) { returnnull; }
Stringbase64= getCookie().readValue(request, response); // Browsers do not always remove cookies immediately (SHIRO-183) // ignore cookies that are scheduled for removal if (Cookie.DELETED_COOKIE_VALUE.equals(base64)) { returnnull; }
public ByteSource decrypt(byte[] ciphertext, byte[] key)throws CryptoException {
byte[] encrypted = ciphertext;
//No IV, check if we need to read the IV from the stream: byte[] iv = null;
if (isGenerateInitializationVectors(false)) { try { //We are generating IVs, so the ciphertext argument array is not actually 100% cipher text. Instead, it //is: // - the first N bytes is the initialization vector, where N equals the value of the // 'initializationVectorSize' attribute. // - the remaining bytes in the method argument (arg.length - N) is the real cipher text.
//So we need to chunk the method argument into its constituent parts to find the IV and then use //the IV to decrypt the real ciphertext: